Re: [squid-users] Unexpected MISSes; patching Accept-Encoding via header_access/header_replace?

From: Itzcak Pechtalt <itzcak_at_gmail.com>
Date: Mon, 6 Oct 2008 19:26:45 +0200

On Mon, Sep 29, 2008 at 4:19 AM, Gordon Mohr <gojomo_at_archive.org> wrote:
> Using 2.6.14-1ubuntu2 in an reverse/accelerator setup.
>
> URLs I hope to be cached aren't, even after adjusting passed headers.
>
> For example, I request an URL with FireFox, get the expected MISS. Then
> request same URL with IE, get unexpected MISS when I'd like a HIT. Then
> request same URL with Chrome, get MISS instead of HIT. Finally, request with
> Safari, finally get a HIT.
>
> I gather that the key variable is the differing Accept-Encoding headers:
>
> Firefox: gzip,deflate
> IE: gzip, deflate
> Chrome: gzip,deflate,bzip2
> Safari: gzip, deflate (same as IE, hence the HIT)
>
> My theory was that stripping the varied header values and replacing them
> with the lowest-common-denominator (and the only variant ever returned by
> the parent server) could help. So I added the following to my squid
> configuration:
>
> header_access Accept-Encoding deny all
> header_replace Accept-Encoding gzip
>
> However, this has not changed the HIT/MISS pattern at all.
>
> Any other ideas for letting all these browsers share the same cached
> version?

If the HTTP response includes "Vary: User-Agent" then Squid will give
HIT only for same
User-Agent, check your case.

>
> (Bonus question: My inner-server's 404 responses include a 24-hour Expires
> header. Will these be cached by squid for the declared period or the shorter
> negative-ttl? The info at
> <http://wiki.squid-cache.org/SquidFaq/InnerWorkings#head-aed2acb07aed79ef1f7a590447b6a45a8dd8e7d1>
> is unclear which wins.)
>
> - Gordon @ IA
>
>

Error caching is called negative cache, and depends on "negative_ttl"
parameter
in squid.conf which default to 5 minutes, so the 404 will be cached
only 5 minutes by default.

Itzcak
Received on Mon Oct 06 2008 - 17:26:50 MDT

This archive was generated by hypermail 2.2.0 : Tue Oct 07 2008 - 12:00:03 MDT