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?