HTTP Vary Header


The Vary HTTP response header permits to add a header value to the cache key used by the cache.


Not mixing content for mobile vs desktop

A server may serve different contents for desktop or mobile depending on the user-agent header.

If the cache uses only the URL has cache key, a desktop page could be served to a mobile page.

To avoid this situation, you can add the user-agent header in the Vary header to instruct caching servers to add the user agent header to the cache key.

Vary: User-Agent


If you don't want to serve the same page to different users.

Vary: Cookie


The Vary header value should be the same:

Discover More
Data System Architecture
Data - Cache

In computer science, a data cache is a component that aims to: improve performance reduce load on the server. The cache will: store transparently a request response and use it to for later...
HTTP - Cache (Cache-Control Header, Bursting, )

When sending a response, several headers have an influence / control over the cache store, we call them cache control headers The cache control header are: Name Description Cache-Control Define properties...
Http Cache Partitioning Example
HTTP - Cache Store

A cache store is an http cache component that caches the http response if the cache control header permits it. There is two type of cache: intermediate cache (proxy) client cache (user-agent cache...
Chrome Devtool Network 304
How to implement and check a Web / HTTP cache ?

Implementing and verifying that the HTTP cache is set and working properly is not a straightforward task. This article gives you a step by step.

Share this page:
Follow us:
Task Runner