Cloudflare ships Vary header support in Cache Rules
The CDN adds tools to handle HTTP's notoriously complex content negotiation mechanism across all plans.
What to know
- Cloudflare added Vary header support to Cache Rules on all plans, letting users normalize content negotiation headers rather than treating every variation as distinct.
- The HTTP Vary header has long been criticized as broken: it signals which request fields affect responses but not which differences actually matter, causing caches to either serve wrong content or explode into thousands of variants.
- The solution lets origins declare what may vary while giving Cloudflare customers fine-grained control over how to handle each variation—normalize, pass through exact values, or bypass cache entirely.
“Without Vary, whichever response enters the cache first can be served to both clients. If HTML wins, the API client receives markup and its JSON parser fails.”
Cloudflare · Cloudflare Blog ↗
Cloudflare CDN providerAlex Krivit Cloudflare authorZaidoon Abd Al Hadi Cloudflare author
How it unfolded 3 developments, newest first · click a bar or a number to jump articlesposts
-
3
Story gains traction on Hacker News
The Cloudflare blog post reached the front page of Hacker News with 105 points and 22 comments, drawing developer attention to the Vary header problem and Cloudflare's solution.
-
2
Technical problem surfaces: Vary creates cache explosion
Cloudflare's blog post explains Vary's core flaw: the header tells caches which request fields may affect a response but not which differences actually matter. Without smart handling, similar requests can spread into thousands of barely-reusable cache entries, while ignoring Vary risks serving wrong content entirely.
“Vary tells a cache which request fields may affect the response, but it does not tell the cache which differences actually matter.”
— Cloudflare -
1
Cloudflare announces Vary header support in Cache Rules
Cloudflare shipped support for the HTTP Vary header across all Cache Rules plans. The feature allows users to normalize negotiation headers, pass exact values through when small differences matter, or bypass cache for unpredictable variations.
“The ugliest part of HTTP that we haven't yet improved.”
— Source cited in Cloudflare blog · source -
first by HN Frontpage, 8h ago
-
first by Cloudflare Blog, 1d ago
-