Spec-Zone.ru › HTTP

Headers: Vary

Vary header

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • Learn more
  • See full compatibility
>

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 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.

Header type Response header

Syntax

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

Specification
HTTP Semantics>
# field.vary>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
Vary 1 12 1 15 1 18 4 14 1 1.0 4.4 1

See also

  • Content negotiation
  • HTTP caching: Vary
  • Understanding The Vary Header on smashingmagazine.com (2017)
  • Best Practices for Using the Vary Header on fastly.com

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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API