Author: Andrew Betts
Andrew is principal developer advocate at Fastly, an elected member of the W3C Technical Architecture Group and co-chair of London Web Performance
Twitter: Follow Andrew Betts on Twitter
We use ad-blockers as well, you know. We gotta keep those servers running though. Did you know that we publish useful books and run friendly conferences — crafted for pros like yourself? E.g. our upcoming SmashingConf London, dedicated to all things web performance.
The Vary HTTP header is sent in billions of HTTP responses every day. But its use has never fulfilled its original vision, and many developers misunderstand what it does or don't even realize that their web server is sending it. With the coming of the Client Hints, Variants and Key specifications, varied responses are getting a fresh start.
In principle, a URL represents not a web page, but a conceptual resource, like your bank statement. Imagine that you want to see your bank statement: You go to
bank.com and send a
GET request for
/statement. So far so good, but you didn't say what format you want the statement in. This is why your browser will also include something like
Accept: text/html in your request. In theory, this means you could say
Accept: text/csv instead and get the same resource in a different format.