Vary HTTP response header determines how to match future request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. It is used by the server to indicate which headers it used when selecting a representation of a resource in a content negotiation algorithm.
Vary: * Vary: <header-name>, <header-name>, ...
: private, which is clearer to read and also signals that the object shouldn't be stored ever.
When using the
Vary: User-Agent header, caching servers should consider the user agent when deciding whether to serve the page from cache. For example, if you are serving different content to mobile users, it can help you to avoid that a cache may mistakenly serve a desktop version of your site to your mobile users. It can help Google and other search engines to discover the mobile version of a page, and might also tell them that no Cloaking is intended.
|RFC 7231, section 7.1.4: Vary||Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content|
|Feature||Android webview||Chrome for Android||Edge mobile||Firefox for Android||IE mobile||Opera Android||iOS Safari|
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.