We just shipped support for the ugliest part of HTTP: Vary
thisisfatih
111 points
24 comments
September 23, 2026
Related Discussions
Found 5 related stories in 76.3ms across 7,510 title embeddings via pgvector HNSW
- Precursor AznHisoka · 158 pts · July 13, 2026 · 43% similar
- Build your own vulnerability harness ianrahman · 32 pts · July 10, 2026 · 42% similar
- A revisit of remote Spectre attacks on Cloudflare Workers albertpedersen · 29 pts · August 19, 2026 · 41% similar
- Cloudflare's new AI traffic options for customers alphabetatango · 84 pts · July 25, 2026 · 40% similar
- Why we're moving off Cloudflare Durable Objects jitpal · 57 pts · July 09, 2026 · 40% similar
Discussion Highlights (11 comments)
simonw
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.)
bhouston
Nice to see. I’ve used vary to quite a bit of success on CloudFront back in the day. I actually assumed when I started using Cloudflare that it did have vary support and it led to a serious bug in my sass app at the time.
xyzzy_plugh
I honestly thought they would never ship this. Holy hell this has been a long time coming. Actual real content negotiation in 2026. Never thought I'd live to see the day.
rob-olmos
"If the origin response does not include a Vary header, Cloudflare caches the response normally"[1] "If one response omits it, Cloudflare could cache that response without the variance needed to keep it isolated."[2] Will that non-Vary cache object front-run any Vary-segmented cache objects? If so, probably worth adding a snippet rule to ensure every response has a Vary header? 1: https://developers.cloudflare.com/cache/concepts/vary/#how-v... 2: https://blog.cloudflare.com/vary-support/#how-a-response-mov...
rgbrenner
finally. now maybe they'll have time to implement a working unsubscribe on their marketing emails.
jrochkind1
I had not actually realized what a mess Vary is. Wow, sometimes I think it's amazing the web works at all!
badlibrarian
If this surprises you, remember that Cloudflare doesn't cache HTML by default.
yellow_lead
A site I work on serves dynamic language content based on the accept-language header. We do this for some pages and others we redirect to i.e /en/page But we can't cache those dynamic pages since they vary based on accept language. Maybe with this we can
colmmacc
Wow this brings back memories. Over twenty years ago I added Vary support to various mod_cache submodules for Apache 2.0, and it was way too high a pain to reward ratio. It just uncovered so many user agent bugs and crazy backends. I remember arguments about being able to cache variable based on non-literal virtual headers (e.g. a geo location header), and a crazy request to Vary based on "Date:" ... which makes absolutely no sense. The whole thing was just too clever for its own good. It's no surprise that language selection ended up in URLs (/en-US/..) rather than "Vary: Accept-Lang" features.
tiffanyh
I just wish CF would enable Enterprise functionality to lower (paid) tiers as they promised a year ago yet haven’t delivered on. https://blog.cloudflare.com/enterprise-grade-features-for-al... Like Prefetch: https://developers.cloudflare.com/speed/optimization/content...
charcircuit
I don't understand why en-US and en-GB should be treated as the same. Wouldn't this result in American visitors seeing words like colour since the wrong English page would be served.