[squid-users] Normalizing user-agent and accept-encoding

From: jabourbih <jon.abourbih_at_gmail.com>
Date: Tue, 20 Aug 2013 05:00:16 -0700 (PDT)

Using Squid in an accelerator (reverse proxy) configuration, I'd like to
normalize the user-agent and accept-encoding headers *before* Squid
generates its cache key.

In other words, I want to ensure that Squid does not cache different
responses for different browsers and/or different orders of acceptable
encodings (e.g. Chrome sends gzip,deflate,sdch, whereas Firefox sends
gzip,deflate; I want to cache only one response). If the upstream server
responds with a Vary: Accept-Encoding, it would cache two responses, which
is not the desired behaviour.

I've looked at request_header_access and request_header_replace, but the
docs say "The option has no effect during cache hit detection."

Is there any way to rewrite the headers so that if gzip is in the
Accept-Encoding header, then the header is rewritten to only contain gzip,
and have Squid use the rewritten header as part of its cache key, rather
than the original request header?

--
View this message in context: http://squid-web-proxy-cache.1019090.n4.nabble.com/Normalizing-user-agent-and-accept-encoding-tp4661669.html
Sent from the Squid - Users mailing list archive at Nabble.com.
Received on Tue Aug 20 2013 - 12:00:58 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 21 2013 - 12:00:43 MDT