Skip to main content
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
Products Infrastructure
Products Infrastructure

Amazon Air plane overruns Miami runway, grounding flights

An Amazon Air plane operated by 21 Air overran a runway while landing at Miami International Airport around 2 p.m. local time Sept. 6, striking vehicles and prompting flight groundings, according to The Verge. The Boeing 767-300 d...

Products Infrastructure
Products Infrastructure

Isar says Spectrum deployed payloads on second flight

Isar Aerospace said its Spectrum vehicle reached orbit and deployed payloads from Andøya Space in Norway on its second flight. The company said the qualification mission completed stage separation, second-stage ignition, circulari...

Products Infrastructure
Products Infrastructure

Imbue launches Cloud in a Bottle self-hosting platform

Imbue has launched Cloud in a Bottle, an open-source personal-cloud platform for running containerized web applications. The platform routes web requests to rootless, hardened containers and provides unified authentication, with o...

Security Products
Security Products

Liquid sidechain pauses after reported 4,000 BTC withdrawal

Liquid says purported white-hat hackers withdrew about 4,000 BTC, valued in its statement at roughly $320 million, from the Liquid Federation wallet. The company says the funds left through the SideSwap Peg-out Authorization Key, ...

AI Infrastructure
AI Infrastructure

Anthropic lines up at least 14.8 GW of compute agreements

Anthropic has entered agreements for at least 14.8 GW of compute capacity since October, according to an analysis by The Information summarized by Techmeme. The analysis says the company has made cloud-computing deals with SpaceX,...

Policy Products
Policy Products

Nigeria opens antitrust probe into Uber's abrupt exit

Nigeria's antitrust commission said it is probing Uber Technologies' abrupt exit from the country after the ride-hailing platform shut down last week without prior notice to users. The supplied summary does not state why Uber exit...