We have a forward proxy for our network which is Squid 2.7. This is managed for us by a third party.

We noticed recently that http requests going from our network to the web were having the Accept-Encoding header removed. This was resulting in all web traffic across our network (approx 8000+ PCs) being uncompressed even though the browsers and server on each end were capable.

We have asked the third party to look into this and they have said it is because Squid 2.7 does not support compression.

I understand this to be true but I was under the impression that the compression happened on the webserver rather than the proxy. So...

  1. Can Squid 2.7 proxy and/or cache content that is gzipped?
  2. If it can, how/why might it be configured such that the Accept-Encoding header is being removed?
  • Have you checked that your clients really are asking for compressed content - there are a large number of supposedly reputable "security" products which deliberately break HTTP compression. – symcbean Oct 19 '13 at 21:41
  • All our PCs have IE8 installed. They include Accept-Encoding header with every request, this works fine with internal web servers, where the proxy in not involved. – Tom Styles Oct 21 '13 at 13:49

Squid 2.7 does cache compressed pages (multiple encodings of a page), if the user requests a compressed page. But if the user requests a non-compressed page, then squid will forward a requests asking for a non-compressed page. and then cache that. If a compressed page was requested but a non-compressed page is cached, the non-compressed page is served by squid. But if the compressed page is cached first, and a non compressed page cached, and then a compressed page requested, the compressed page will be served from cache.

I find squid will cache multiple encodings of a page only if and when a non-compressed page is not cached first/requested first, or else the non-compressed page will get cached, and since accept-encoding is conditional, there is no reason for squid to fetched a compressed page since the request will be okay with non-compressed encoding page.

#   TAG: cache_vary
#   When 'cache_vary' is set to off, response that have a
#   Vary header will not be stored in the cache.
cache_vary on

cache_vary needs to be turned on, so that multiple encodings of a page is cached.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.