Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
HTTP Vary header question
Old 04-17-2011, 11:34 PM HTTP Vary header question
Junior Talker

Posts: 5
Trades: 0
I have been using the popular hack of serving plain HTML to MSIE, and XHTML
to everyone else:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} \.xhtml$
RewriteCond %{HTTP_USER_AGENT} MSIE [OR]
RewriteCond %{HTTP_USER_AGENT} Lynx [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml\s*;\s*q=0\.?0*(\s|,|$)
RewriteRule .* - [T=text/html]

I also have Cache-Control set to "public". The dilemma I am facing (and please correct me if I am wrong) is that the Vary header has to be set to something that would prevent the public cache from, e.g., storing a response sent to Firefox and then serving it to MSIE. I think (again, correct me if I'm wrong), User-Agent can be added to Vary, and this would do the right thing. The problem is: this more or less defeats the purpose of public caching, given how many User-Agent strings are in use.

Is there a more efficient way? If so, how would I incorporate this into the above snippet?
FreedomFighter is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-18-2011, 07:22 AM Re: HTTP Vary header question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Well! Seeing how the "hacking" with the content type was more IE6 trickery.


You can stop messing about with it now.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-18-2011, 04:31 PM Re: HTTP Vary header question
Junior Talker

Posts: 5
Trades: 0
Thanks for the reply, ChrisHirst. But isn't it true that the same goes for
ANY MSIE<9? In other words, don't IE7,8 go into quirks mode when the
MIME type is application/xml+xhtml, just like IE6?

I recently asked a related question:
http://tycoontalk.freelancer.com/htm...rsion-1-a.html

and your reply seemed to suggest that IE7,8 act "quirky" on XHTML. No difference from IE6. Am I mistaken?
FreedomFighter is offline
Reply With Quote
View Public Profile
 
Old 04-18-2011, 05:15 PM Re: HTTP Vary header question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's just the xml declaration being there that can trigger quirksmode

The MIME type + XML prolog issue was fixed in IE7
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to HTTP Vary header question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.73034 seconds with 12 queries