httphttp-headersvary

Multiple Vary HTTP headers or one combined?


Question: What is the best way to send Vary HTTP header when server accept gzip/deflate connections AND serve a different content for mobile clients?

I see two possible variants but I cannot find any useful information whether they are correct and/or supported by most proxies and search engines:

  1. Combine variants to a single line: Vary: Accept-Encoding,User-Agent
  2. Send two separate headers:

Vary: Accept-Encoding

Vary: User-Agent

Any information or link to appropriate W3C standard are welcome :)


Solution

  • Both are valid (and mean the same thing).

    And no, the W3C isn't relevant here. You will need to look into the IETF RFCs 7230 and 7231.