W3cubDocs

/HTTP

Vary

Vary

The Vary HTTP response header describes the parts of the request message aside from the method and URL that influenced the content of the response it occurs in. Most often, this is used to create a cache key when content negotiation is in use.

The same Vary header value should be used on all responses for a given URL, including 304 Not Modified responses and the "default" response.

Syntax

Vary: *
Vary: <header-name>, <header-name>, ...

Directives

*

Indicates that factors other than request headers influenced the generation of this response. Implies that the response is uncacheable.

<header-name>

A comma-separated list of request header names that could have influenced the generation of this response.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
Vary
Yes
12
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

Compatibility notes

See also

© 2005–2022 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary