Accept-Encoding: gzip and the Vary header
mdounin at mdounin.ru
Thu Jun 4 14:25:40 UTC 2015
On Thu, Jun 04, 2015 at 03:41:32PM +0200, Xavier Noria wrote:
> On Thu, Jun 4, 2015 at 3:11 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> The problem with Vary is that it causes bad effects on shared caches, in
> > particular, it normaly results in cache duplication.
> You mean that if client A requests a resource with Accept-Encoding: gzip,
> and client B without, and the resource has Cache-Control: public, then a
> shared cache would store the compressed and uncompressed responses thus
> having the content kind of repeated?
Not really. The main problem is that there is more than 2
clients, and many of them will use different Accept-Encoding
gzip;q=1.0, deflate;q=0.8, chunked;q=0.6, identity;q=0.4, *;q=0
gzip, deflate, peerdist
gzip, deflate, identity
gzip, deflate, compress
As a result, there will be many copies of compressed and
uncompressed responses in the cache.
More information about the nginx