Vary header
The HTTP Vary 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.
The HTTP **`Vary`** 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](/docs/Web/HTTP/Guides/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.
<table class="properties">
<tbody>
<tr>
<th scope="row">Header type</th>
<td>Response header</td>
</tr>
</tbody>
</table>
## Syntax
```http
Vary: *
Vary: <header-name>, …, <header-nameN>
```
## Directives
- `*` (wildcard)
- : Factors other than request headers influenced the generation of this response. Implies that the response is uncacheable.
- `<header-name>`
- : A request header name that could have influenced the generation of this response.
## Specifications
## Browser compatibility
## See also
- [Content negotiation](/docs/Web/HTTP/Guides/Content_negotiation)
- [HTTP caching: Vary](/docs/Web/HTTP/Guides/Caching#vary)
- [Understanding The Vary Header](https://www.smashingmagazine.com/2017/11/understanding-vary-header/) on smashingmagazine.com (2017)
- [Best Practices for Using the Vary Header](https://www.fastly.com/blog/best-practices-using-vary-header) on fastly.com
Cite this
"Vary header". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy