Vary header.
also: Vary · cache key · cache keysThe cache key is what a cache stores a response under (URL + query by default); Vary adds request headers, like Accept-Encoding, to it.
the two-minute refresher
- Same URL, different query string = different cache entries.
- Vary: Accept-Encoding keeps gzip and brotli versions apart.
- Varying on high-cardinality headers (User-Agent, Cookie) shatters the hit ratio.