[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-modgzip
Subject: [Mod_gzip] Sending Header based upon Protocol
From: Eli White <ewhite () stsci ! edu>
Date: 2002-03-14 16:53:30
[Download RAW message or body]
Is it not possible?
I've decided from talking to a few people that the easiest/simplist/safest
way to implement mod_gzip and not have problems ...
Is to only allow HTTP/1.1 requests. This will ignore bad proxies, and bad
browsers. A bit harsh, but does the job (60% of our requests are HTTP/1.1
right now, so it helps a significant portion of the populace).
However. From what I understand, I still need to send a 'Vary' header
saying : "Vary: Accept-Encoding", right? to make a HTTP/1.1 proxy
understand that different content is coming back at them.
Problem is, I need to only send it for HTTP/1.1 requests.
Is this possible? At all?
I can do the following:
SetEnvIf Request_Protocol "^HTTP/1.1$" http11
But now how can I have a conditional section (like <Directory> or
<Location>) based upon an Environment Variable?? I don't see a way.
The only possible way I see to accomplish this, is QUITE convoluted, Using
mod_rewrite to 'change' the URL (either adding a suffix, or a
subdirectory). Then being able to use <Files> or <Location> to map this
URL (which happens to be the original, and return the 'Vary' Header)
Is this the only way?
Something like:
...
DocumentRoot /var/html/htdocs
...
Alias /http11 /var/html/htdocs
<Location /http11>
Header set Vary Accept-Encoding
</Location>
...
RewriteEngine on
RewriteCond %{THE_REQUEST} HTTP/1\.1$
RewriteCond %{REQUEST_URI} !^/http11
RewriteRule (.*) /http11$1 [PT]
This works, setting the Vary only for HTTP/1.1 browsers, but is QUITE
convoluted for such a 'simple' task. (And actually, the above should be a
little more complicated, to only do this for files that aren't compressed
in the first place, and not to rewrite .gifs/.jpgs/etc.)
So, what about the simple solutions? How 'bad' is it to NOT return a Vary,
if you are only responding to 1.1 responses anyway? Should a 1.1 Proxy
understand the compressed data, and therefore serve it correctly 'down below?'.
How 'bad' is it to just ALWAYS send a Vary, even perhaps for
images/etc. Sure, it may not actually be 'Vary-ing', but it gets the point
across, even at the slight increased cost to the proxies of storing
different versions for no reason.
Thanks,
Eli
_______________________________________________
mod_gzip mailing list
mod_gzip@lists.over.net
http://lists.over.net/mailman/listinfo/mod_gzip
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic