HTTP: The Definitive Guide
by David Gourley, Brian Totty, Marjorie Sayer, Anshu Aggarwal, Sailu Reddy
Name
Vary
Synopsis
The Vary header is used by servers to inform clients what headers from a client’s request will be used in server-side negotiation.[10] Its value is a list of headers that the server looks at to determine what to send the client as a response.
An example of this would be a server that sends special HTML pages based on your web browser’s features. A server sending these special pages for a URL would include a Vary header that indicated that it looked at the User-Agent header of the request to determine what to send as a response.
The Vary header also is used by caching proxies; see Chapter 7 for more on how the Vary header relates to cached HTTP responses.
Type
Response header
Basic Syntax
Vary: (“*” | 1# field-name)
Example
Vary: User-Agent
[10] See Chapter 17 for more on content negotiation.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access