// http header · caching header

Vary

Which request headers affect the cached response

What the Vary header does

Vary lists the request headers that affect which response a cache should serve — Vary: Accept-Encoding keeps gzip and Brotli variants separate. Getting it right prevents caches from serving the wrong representation to a client.

Example

Vary: Accept-Encoding

Where it's used

Vary is a caching header. Caching headers control how browsers and proxies store and reuse responses.

Other caching headers