# We just shipped support for the ugliest part of HTTP: Vary

DevFeed: [We just shipped support for the ugliest part of HTTP: Vary](<https://devfeed.tech/articles/we-just-shipped-support-for-the-ugliest-part-of-http-vary-60673.md>)

Original publisher: [Read original article](<https://simonwillison.net/2026/Sep/23/hn-49823961/>)

Author: Simon Willison

Published: 2026-09-23T23:14:57Z

Content type: article

Language: en

Sources: [Simon Willison's Weblog](<https://devfeed.tech/sources/simon-willison-s-weblog.md>)

Topics: [HTTP](<https://devfeed.tech/topics/http.md>), [cache-control](<https://devfeed.tech/topics/cache-control.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [cloudflare](<https://devfeed.tech/tags/cloudflare.md>), [cloudflare-34](<https://devfeed.tech/tags/cloudflare-34.md>), [http](<https://devfeed.tech/tags/http.md>), [http-125](<https://devfeed.tech/tags/http-125.md>)

## AI overview

The author welcomes Cloudflare support for the HTTP Vary header in caching, which lets responses vary by request headers such as Accept. Previously, Cloudflare could cache one format and serve it to clients expecting another. The author says they still prefer predictable URLs, using a .json suffix when an app should return JSON.

## Source excerpt

My comment on We just shipped support for the ugliest part of HTTP: Vary -- Hacker News. I've been wanting this from Cloudflare for years. The classic problem here is if you do that thing where user agents that send "accept: text/html" get HTML, while user agents that don't get JSON or some other format. This used to be impossible to deploy behind Cloudflare caching, because they ignored the Vary header on anything other than images - so you risked caching the JSON version and then serving it up to someone who was expecting HTML. (Independent of the Cloudflare feature I ended up deciding never to use that pattern, because I prefer having URL that predictably returns HTML or JSON - I add a .json suffix to my apps to serve JSON instead.) Tags: http, cloudflare