AivexaNewsSearch
AI news for builders and product teamsChecked every hour
Simon WillisonDeveloper tools

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

Collected Sep 30, 2026

Simon Willison commented on Cloudflare shipping support for the Vary header, describing it as support for what he called the ugliest part of HTTP. He wrote that he had been wanting this from Cloudflare for years.

Willison described the classic problem the feature addresses: configuring a server so user agents that send "accept: text/html" receive HTML, while user agents that do not receive JSON or another format. He said this pattern used to be impossible to deploy behind Cloudflare caching, because Cloudflare ignored the Vary header on anything other than images. That created a risk of caching the JSON version and then serving it to someone expecting HTML.

Willison said that independently of the Cloudflare feature, he decided never to use that pattern, because he prefers a URL that predictably returns HTML or JSON. He said he adds a .json suffix to his apps to serve JSON instead.

The comment appeared on a Hacker News discussion of the Cloudflare change. Willison tagged the post with http and cloudflare.

Read at Simon Willison

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher 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 wh