docs.rodeo

MDN Web Docs mirror

Vary

{{HTTPSidebar}} 

The HTTP Vary {{Glossary("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. Including a Vary header ensures that responses are separately cached based on the headers listed in the Vary field. 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 {{HTTPStatus("304")}}  Not Modified responses and the “default” response.

Header type `{{Glossary("Response header")}}` 
`{{Glossary("Forbidden header name")}}`  No

Syntax

Either * as a wildcard, or one or more header names in a comma-separated list:

Vary: *
Vary: <header-name>, …, <header-nameN>

Directives

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN