Why does mod_deflate always add the 'Vary' header?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was beating my head against a wall for a day about a caching issue,
but I think I figured the problem out now.  It seems like mod_deflate
is adding the 'Vary' header to all responses regardless of whether
they were actually compressed or not.  Here's a snippet of the HTTP
session for a static HTML file:

$ curl --header 'Host: www.domain.com' -v -s -o/dev/null
http://X.X.X.X/static.htm
* About to connect() to X.X.X.X port 80 (#0)
*   Trying X.X.X.X... connected
* Connected to X.X.X.X (X.X.X.X) port 80 (#0)
> GET /static.htm HTTP/1.1
> User-Agent: curl/7.21.7 (x86_64-pc-linux-gnu) libcurl/7.21.7 NSS/3.12.10.0 zlib/1.2.5
> Accept: */*
> Host: www.domain.com
>
< HTTP/1.1 200 OK
< Date: Tue, 30 Aug 2011 18:39:47 GMT
< Server: Apache
< Last-Modified: Tue, 30 Aug 2011 17:59:49 GMT
< Accept-Ranges: bytes
< Content-Length: 247
< Vary: Accept-Encoding
< Cache-Control: max-age=2592000
< Connection: close
< Content-Type: text/html
<
{ [data not shown]
* Closing connection #0



I then referenced the mod_deflate.c source code, and found the following:
       /* Even if we don't accept this request based on it not having
        * the Accept-Encoding, we need to note that we were looking
        * for this header and downstream proxies should be aware of that.
        */
       apr_table_mergen(r->headers_out, "Vary", "Accept-Encoding");


What is the reasoning for adding the 'Vary' header even if mod_deflate
does nothing with the response?


Thanks,
Mike

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux