Re: [squid-users] squid ignoring content-encoding in vary?

From: Mark Gibson <mark@dont-contact.us>
Date: Mon, 02 Apr 2007 10:48:52 -0600

Henrik Nordstrom wrote:
> tor 2007-03-29 klockan 20:10 -0600 skrev Mark Gibson:
>> I'm trying to cache pages based on Accept-Encoding, doesn't seem to be
>> working.
>
> Works for me from what I can tell..
>
>> I've put Accept-Encoding in the vary tag.
>
> Please include full request/response headers of two requests to ease
> discussion. At minimum:
>
> Vary response header
> Server response header
> Vary mentioned request headers
>

Thanks Henrik.

I'm using wget to test this. In the first request, I send
--header='Accept-Encoding:gzip,deflate'. In the second, I don't set any
header. Both requests result in a gzipped file from the cache.

Let me know if you need more information that I omitted.

Thanks,
Mark

-------
######################
Request gzipped file
######################
[mark@foo squid]$ wget -S --save-headers
--header='Accept-Encoding:gzip,deflate'
http://www.foo.com:10080/domestic_help
--10:32:58-- http://www.foo.com:10080/domestic_help
            => `domestic_help.7'
Resolving www.foo.com... 69.20.124.205
Connecting to www.foo.com|69.20.124.205|:10080... connected.
HTTP request sent, awaiting response...
   HTTP/1.0 200 OK
   Date: Mon, 02 Apr 2007 16:32:57 GMT
   Server: Zope/(unreleased version, python 2.3.4, linux2) ZServer/1.1
   Expires: Mon, 02 Apr 2007 16:32:57 +0000
   Vary: Cookie,Accept-Encoding
   Last-Modified: Mon, 02 Apr 2007 16:32:57 +0000
   ETag:
   Cache-Control: s-maxage=3600,must-revalidate,proxy-revalidate,max-age=0
   Content-Type: text/html
   X-Cache: MISS from apache.foo.com
   Content-Encoding: gzip
   Content-Length: 2342
   Age: 18
   X-Cache: HIT from foo.com
   Via: 1.0 foo.com:10080 (squid/2.6.STABLE12)
   Connection: keep-alive
Length: 2,342 (2.3K) [text/html]

10:33:07 (24.62 KB/s) - `domestic_help.7' saved [2342/2342]

######################
Request non-gzipped file
######################
[mark@foo squid]$ wget -S --save-headers
http://www.foo.com:10080/domestic_help
--10:33:07-- http://www.foo.com:10080/domestic_help
            => `domestic_help.8'
Resolving www.foo.com... 69.20.124.205
Connecting to www.foo.com|69.20.124.205|:10080... connected.
HTTP request sent, awaiting response...
   HTTP/1.0 200 OK
   Date: Mon, 02 Apr 2007 16:32:57 GMT
   Server: Zope/(unreleased version, python 2.3.4, linux2) ZServer/1.1
   Expires: Mon, 02 Apr 2007 16:32:57 +0000
   Vary: Cookie,Accept-Encoding
   Last-Modified: Mon, 02 Apr 2007 16:32:57 +0000
   ETag:
   Cache-Control: s-maxage=3600,must-revalidate,proxy-revalidate,max-age=0
   Content-Type: text/html
   X-Cache: MISS from apache.foo.com
   Content-Encoding: gzip
   Content-Length: 2342
   Age: 27
   X-Cache: HIT from foo.com
   Via: 1.0 foo.com:10080 (squid/2.6.STABLE12)
   Connection: keep-alive
Length: 2,342 (2.3K) [text/html]

10:33:07 (24.62 KB/s) - `domestic_help.8' saved [2342/2342]
Received on Mon Apr 02 2007 - 10:49:19 MDT

This archive was generated by hypermail pre-2.1.9 : Tue May 01 2007 - 12:00:01 MDT