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
Capital AI
Capital AI

Nevis raises $70M with Schwab joining wealth software investors

Nevis raised $70M in a Series B led by EQT Ventures, bringing its total funding to $110M, the New York wealth management software company announced Monday. Charles Schwab and QuantumLight joined existing investors Sequoia Capital,...

Robotics Capital
Robotics Capital

Bedrock Robotics raises $600M at a $4.1B valuation

Bedrock Robotics raised a $600M Series C at a $4.1B valuation, Bloomberg reported. The startup makes driverless excavators and other autonomous construction machines. The financing adds capital to a company developing autonomous ...

Capital
Capital

Matiks raises $10 million to expand puzzle games and game creation

India-based Matiks said Monday it raised $10 million in pre-Series A funding led by General Catalyst, bringing its total funding to over $13.5 million. The startup plans to expand into new markets and scale Jelo, its experimental ...

Security
Security

Apple patches 329 unique vulnerabilities across its software

Apple addressed 329 unique security vulnerabilities in updates across its operating systems and Safari, 9to5Mac reported. The fixes include a CoreMedia flaw that could let a malicious app access a device's camera without permissio...

AI Products
AI Products

AWS makes GPT-6.1 Terra generally available on Bedrock

AWS announced general availability of OpenAI's GPT-6.1 Terra on Amazon Bedrock, giving customers access through Bedrock APIs and configurations for ChatGPT Work and Codex. The model accepts text and images and supports up to 1 mil...

AI
AI

OpenAI releases GPT-6.1 Terra at $1 per million input tokens

OpenAI has released GPT-6.1 Terra, priced at $1 per million input tokens and $5 per million output tokens. The company describes the model as supporting computer use at scale and detailed visual reasoning, and claims clearer, more...