How do HTTP proxy caches decide between serving identity- vs. gzip-encoded resources?

Posted by mrclay on Stack Overflow See other posts from Stack Overflow or by mrclay
Published on 2009-03-29T16:39:35Z Indexed on 2010/03/17 20:31 UTC
Read the original article Hit count: 224

An HTTP server uses content-negotiation to serve a single URL identity- or gzip-encoded based on the client's Accept-Encoding header.

Now say we have a proxy cache like squid between clients and the httpd.

If the proxy has cached both encodings of a URL, how does it determine which to serve?

The non-gzip instance (not originally served with Vary) can be served to any client, but the encoded instances (having Vary: Accept-Encoding) can only be sent to a clients with the identical Accept-Encoding header value as was used in the original request.

E.g. Opera sends "deflate, gzip, x-gzip, identity, *;q=0" but IE8 sends "gzip, deflate". According to the spec, then, caches shouldn't share content-encoded caches between the two browsers. Is this true?

© Stack Overflow or respective owner

Related posts about http

Related posts about caching