Re: [squid-users] Vary / Accept-Encoding / mod_gzip Redux

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 7 May 2003 23:39:16 +0200

On Wednesday 07 May 2003 22.14, R Pickett wrote:

> For the most part, the whole "Vary: Accept-Encoding" scheme is
> working perfectly with squid caching mod_gzip content. The issue
> comes when a browser doesn't send an Accept-Encoding header, as is
> the case both for MSIE and Safari on OS X, at the very least. In
> this situation, squid will send back the gzip-encoded content (if
> it's in the cache -- if we go back to the origin server, the right
> thing happens), which neither of the above mentioned browsers can
> handle.

This can only happen if the web server for another request for the
same URL sent a gzipped reply without including a Vary header telling
on what it decided to send the gzipped reply.

> In the August thread, it was pointed out that the RFC specifically
> states that a lack of an Accept-Encoding header means that the
> server may assume the browser can accept any content encoding, so
> squid (playing the role of the 'server' in this drama) is being
> RFC-compliant, but is still sending incorrect content.

Squid does not make any assumptions. It just tries to do what it is
told by the web server. If the web server says that Accept-Encoding
is not relevant for the reply by not including a Vary:
Accept-Encoding header then Squid will not pay any attention to the
precense or value of any Accept-Encoding headers. Similarily for the
User-Agent header etc.

> Is there a simple fix to make squid serve up 'identity' content if
> it gets a request with no Accept-Encoding header? Or some other
> hack that will have the same effect?

Yes, make sure the web server never responds with gzipped content
unless there is an Accept-Encoding: gzip header, and that it always
includes the appropriate Vary header when sending a gzipped response.

If the web server ever responds with a gzipped reply to a request
without Accept-Encoding: gzip, without at least including a Vary:
user-agent header then Squid will happily give the gzipped content to
any requestor, no matter what they accept or what user-agent they
use, until this object is expired from the cache, as this is what the
web server told Squid to do.

Regards
Henrik

-- 
Donations welcome if you consider my Free Squid support helpful.
https://www.paypal.com/xclick/business=hno%40squid-cache.org
If you need commercial Squid support or cost effective Squid or
firewall appliances please refer to MARA Systems AB, Sweden
http://www.marasystems.com/, info@marasystems.com
Received on Wed May 07 2003 - 15:38:59 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:16:21 MST