You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by pq...@apache.org on 2005/04/17 22:25:58 UTC

svn commit: r161691 - in httpd/httpd/trunk: CHANGES modules/filters/mod_deflate.c

Author: pquerna
Date: Sun Apr 17 13:25:57 2005
New Revision: 161691

URL: http://svn.apache.org/viewcvs?view=rev&rev=161691
Log:
mod_deflate should be merging the Vary header, not Setting it, and ignoring what other modules put there.

Spotted By: Rici Lake

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/filters/mod_deflate.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?view=diff&r1=161690&r2=161691
==============================================================================
--- httpd/httpd/trunk/CHANGES (original)
+++ httpd/httpd/trunk/CHANGES Sun Apr 17 13:25:57 2005
@@ -1,6 +1,10 @@
 Changes with Apache 2.1.5
 
   [Remove entries to the current 2.0 section below, when backported]
+  
+  *) mod_deflate: Merge the Vary header, isntead of Setting it. Fixes
+     applications that send the Vary Header themselves, and also apply 
+     mod_defalte as an output filter. [Paul Querna]
 
   *) mod_rewrite: use buffered I/O for RewriteMap txt: files.  This
      can result in a major performance improvement when the files are

Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/filters/mod_deflate.c?view=diff&r1=161690&r2=161691
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c Sun Apr 17 13:25:57 2005
@@ -315,7 +315,7 @@
          * the Accept-Encoding, we need to note that we were looking
          * for this header and downstream proxies should be aware of that.
          */
-        apr_table_setn(r->headers_out, "Vary", "Accept-Encoding");
+        apr_table_mergen(r->headers_out, "Vary", "Accept-Encoding");
 
         /* force-gzip will just force it out regardless if the browser
          * can actually do anything with it.



Re: mod_deflate setting Vary

Posted by Rici Lake <ri...@ricilake.net>.
On 17-Apr-05, at 5:30 PM, Roy T. Fielding wrote:

> On Apr 17, 2005, at 1:25 PM, pquerna@apache.org wrote:
>
>> +
>> +  *) mod_deflate: Merge the Vary header, isntead of Setting it. Fixes
>> +     applications that send the Vary Header themselves, and also 
>> apply
>> +     mod_defalte as an output filter. [Paul Querna]

>> -        apr_table_setn(r->headers_out, "Vary", "Accept-Encoding");
>> +        apr_table_mergen(r->headers_out, "Vary", "Accept-Encoding");

> Is deflate setting Vary here because it is changing the
> Content-Encoding, or is this part also done for Transfer-Encoding?

It's setting the Content-Encoding, at this point based on its 
interpretation
of the Accept-Encoding header. mod_deflate does not implement 
Transfer-Encoding
as far as I can see.

It doesn't quite get the Accept-Encoding right. It treats:

   Accept-Encoding: gzip;q=0

as accepting gzip encoding, and it treats:

   Accept-Encoding: *

as not accepting gzip encoding.

I could not find any bug reports complaining about this, so I don't 
think that fixing it is high priority. But I've put it on my tuit list 
anyway. For what that's worth.

The use of setn rather than mergen does create caching issues, although 
it happens to work with mod_negotiation (because mod_negotiation puts 
Vary: headers in err_headers_out instead of headers_out). I couldn't 
find any bug reports complaining about the caching issue either, but 
the fix is trivial.

> It should not be setting Vary for changes to the Transfer-Encoding.
>
> ....Roy


mod_deflate setting Vary

Posted by "Roy T. Fielding" <fi...@gbiv.com>.
On Apr 17, 2005, at 1:25 PM, pquerna@apache.org wrote:

> +
> +  *) mod_deflate: Merge the Vary header, isntead of Setting it. Fixes
> +     applications that send the Vary Header themselves, and also apply
> +     mod_defalte as an output filter. [Paul Querna]
>
>    *) mod_rewrite: use buffered I/O for RewriteMap txt: files.  This
>       can result in a major performance improvement when the files are
>
> Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
> URL:  
> http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/filters/ 
> mod_deflate.c?view=diff&r1=161690&r2=161691
> ======================================================================= 
> =======
> --- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_deflate.c Sun Apr 17  
> 13:25:57 2005
> @@ -315,7 +315,7 @@
>           * the Accept-Encoding, we need to note that we were looking
>           * for this header and downstream proxies should be aware of  
> that.
>           */
> -        apr_table_setn(r->headers_out, "Vary", "Accept-Encoding");
> +        apr_table_mergen(r->headers_out, "Vary", "Accept-Encoding");

Is deflate setting Vary here because it is changing the
Content-Encoding, or is this part also done for Transfer-Encoding?

It should not be setting Vary for changes to the Transfer-Encoding.

....Roy