Skip to main content

Share story

Products Infrastructure

Cloudflare launches Cache Response Rules to fix origin headers that break CDN caching

Cloudflare launches Cache Response Rules to fix origin headers that break CDN caching Image: Primary
Cloudflare said it is introducing Cache Response Rules, a new rule type that runs after an origin server replies but before Cloudflare caches the content. The company said the feature targets cases where response headers such as Set-Cookie or Cache-Control make assets uncacheable at the edge even when the body itself is safe to store. According to the Cloudflare Blog, existing Cache Rules operate in the request phase and decide whether to look up cache, under what key, and with what TTL settings before talking to the origin. Cache Response Rules run in the response phase and can strip headers, rewrite Cache-Control directives, and manage cache tags once the origin response is visible. When a cache rule and a cache response rule conflict, the blog said the cache response rule wins. The post said three actions are available today: strip headers such as Set-Cookie, ETag, or Last-Modified before cache evaluation; set, add, or remove cache tags used for purge-by-tag, including tags derived from response headers such as Surrogate-Keys; and modify Cache-Control directives including max-age, s-maxage, stale-if-error, stale-while-revalidate, private, no-cache, no-store, and related flags. Directives can be marked cloudflare_only so they affect Cloudflare caching without changing the Cache-Control value sent to the browser. Cloudflare said prior workarounds were changing the origin, writing a Worker that re-fetches and rewrites the response, or accepting a worse hit ratio. The company said Cache Response Rules apply the fix at the edge without origin code changes. The blog noted response-phase rules cannot change the cache key, which is fixed in the request phase, and cannot make a previously ineligible request cacheable after the origin fetch has already been paid for.
Sources
In this story
Published by Tech & Business, a media brand covering technology and business. This story was sourced from The Cloudflare Blog and reviewed by the T&B editorial agent team.
Back to Newswire
Keep reading
Full wire
Infrastructure Products
Infrastructure Products

Amazon commits more than €16 billion to German operations in 2027

Amazon announced plans to invest more than €16 billion ($18 billion) in Germany in 2027, including €4.8 billion to expand its AWS data centre region around Frankfurt. The company also plans a second robotics and AI research lab in...

Infrastructure Products
Infrastructure Products

AI computing supplier Elice falls 32% in Seoul debut

South Korean AI computing supplier Elice fell 32% in its stock market debut in Seoul on Tuesday, Bloomberg reported. The company operates in the neocloud sector, which supplies data center computing for artificial intelligence sys...

Products Infrastructure
Products Infrastructure

3M ties Amazon stock warrant to data-center product purchases

3M has expanded its commercial relationship with Amazon and issued an Amazon subsidiary a warrant worth more than $521 million, Investing.com reported. The agreement links most of the stock rights to Amazon's purchases of 3M's opt...

Infrastructure
Infrastructure

Cloudflare offers experimental Rust port of TypeScript compiler

Cloudflare has made an experimental release of tsrs, a Rust port of the TypeScript compiler, available through npm. The company says early benchmarks show it runs up to 8x faster and uses ~70% less memory than TypeScript 7.0 with ...

Capital AI
Capital AI

Daytona raises $60M Series B at $1B valuation

Daytona raised a $60M Series B led by FirstMark at a $1B valuation, Fortune reported. The company is building cloud infrastructure for AI agents. The round brings Daytona's total funding to $91M, adding capital for its infrastruct...