Search code examples
httpcache-control

Is it valid to list multiple fields in a single Vary header?


I know you can do this

Vary: Accept-Encoding
Vary: Accept-Language

but can you do this

Vary: Accept-Encoding, Accept-Language

Solution

  • Yes.

    That's, btw, true for all header fields that can occur multiple times (with the exception of set-cookie, which has broken syntax). See HTTP/1.1, part 1: URIs, Connections, and Message Parsing - Section 3.2.