|
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?
|