Quick presets
Start from a common response pattern, then fine-tune if needed.
Build a safe Vary header for compression, language, origin, or device-specific responses. See how each selected request header affects cache fragmentation, when Vary: * is a bad idea, and copy deployment snippets without leaving the page.
Start from a common response pattern, then fine-tune if needed.
Choose the request headers that truly change your response body or critical headers.
A lean Vary header is better than an overfit one. Keep your cache key small.
Vary: Accept-Encoding
Copy a starting point for your stack, then adapt it to your app logic.
Accept-Encoding for gzip/br differences.Accept-Language when server-rendered content changes by locale.Origin only when your response changes per origin, often with reflected CORS headers.User-Agent usually explodes cache keys. Prefer feature detection or normalized device buckets.Vary: * because it tells caches the response cannot be reused for other requests.