The current behaviour of mod_deflate is to set the Vary: Accept-Encoding
header dependant on the fact, whether the client sent Accept-Encoding: gzip
or not.
However, I think, that behaviour is not correct. At the time, the DEFLATE
filter is activated, the resource actually /does/ vary on Accept-Encoding.
Independant from what the client accepts or not. The attached patch moves
the Vary header setting to the time before the filter checks the supplied
Accept-Encoding but after the time, it checks whether the stream is already
compressed (and probably already correct labeled with a Vary header).
nd
--
die (eval q-qq:Just Another Perl Hacker
:-)
# Andr� Malo, <http://www.perlig.de/> #
Index: mod_deflate.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/filters/mod_deflate.c,v
retrieving revision 1.24
diff -u -r1.24 mod_deflate.c
--- mod_deflate.c 30 Aug 2002 16:31:17 -0000 1.24
+++ mod_deflate.c 9 Nov 2002 22:38:50 -0000
@@ -306,6 +306,8 @@
}
}
+ apr_table_setn(r->headers_out, "Vary", "Accept-Encoding");
+
/* if they don't have the line, then they can't play */
accepts = apr_table_get(r->headers_in, "Accept-Encoding");
if (accepts == NULL) {
@@ -369,7 +371,6 @@
else {
apr_table_mergen(r->headers_out, "Content-Encoding", "gzip");
}
- apr_table_setn(r->headers_out, "Vary", "Accept-Encoding");
apr_table_unset(r->headers_out, "Content-Length");
/* initialize deflate output buffer */