Is Vary: Accept-Encoding overkill?

后端 未结 1 1252
不思量自难忘°
不思量自难忘° 2021-02-05 03:44

After reading about how gzip compression works it got me thinking. If the Origin and Proxy server (CDN) both support gzip is adding a Vary: Accept-Encoding header n

1条回答
  •  情书的邮戳
    2021-02-05 04:24

    The Vary: Accept-Encoding header has more to do with caching than compression. When the Vary: Accept-Encoding header is present, it tells the client that the file can be cached/is the same whether or not the client requests compression.

    If for some reason the client has an uncompressed version of the file in its cache, it will know not to subsequently request a compressed version of it again and instead to just use the uncompressed file from the cache.

    More here: What does vary:accept-encoding mean?

    0 讨论(0)
提交回复
热议问题