DELAPARRA
Index
Color
NL
Category: HTTP headers

Vary

Explained by Updated

What is Vary?

Vary: Tells caches which request headers affect the response. Without it, a cache might serve the wrong variant. The Vary response header tells caches which request headers affect the response. Vary: Accept-Encoding means the compressed and uncompressed versions must be cached separately. Vary: Accept-Language does the same per language. Without it, a shared cache or CDN might serve a gzip-compressed response to a client that cannot handle it, or a Dutch page to an English visitor.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Vary

What should you keep in mind with Vary?

Keep the list short. Vary: Cookie or Vary: User-Agent create so many variants that caching becomes almost useless. It is often better to use separate URLs for different versions, such as /nl/ for Dutch pages, which caches cleanly and is better for SEO too. Web servers usually add Vary: Accept-Encoding automatically when they compress responses.

What does an example of Vary look like?

Vary: Accept-Encoding, Accept-Language

At a glance

CategoryHTTP headers
Explained by
Updated

More HTTP headers terms

All terms starting with V

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.