Cache Reserve: Closing the Gap to a 100% Cache Hit Ratio

Every second, Cloudflare serves tens of millions of requests from its global cache, delivering multiple terabytes of data per second. The goal is simple: serve as much content as possible from data centers close to visitors. High cache hit ratios mean faster load times for users, lower origin egress costs for site owners, and a more resilient content delivery infrastructure.

But hitting that ideal 100% ratio is elusive. The challenge is that not all content is created equal in terms of popularity.

The Problem with Popularity Contests

Cloudflare’s caching strategy relies on efficiency across its massive network. To prevent inefficiencies, the network uses a least recently used (LRU) algorithm. When a data center’s storage is full, less-popular content is evicted to make room for assets that are in higher demand. This system works well for the majority of traffic, but it can penalize customers with massive libraries of "long tail" content—assets that are requested sparingly over time.

For these customers, the risk is that unpopular content is repeatedly evicted and then pulled back from the origin each time it’s requested again. This can lead to significant egress charges and wasted origin resources. Pay-to-play models exist at other CDNs to guarantee cache residency, but Cloudflare does not charge based on where or how long content is cached. Instead, it must rely on other signals to manage the cache effectively.

A Persistent Upper Tier

Cache Reserve is designed to solve this issue by removing customer content from the popularity contest entirely. It is a large, persistent data store built on top of R2. Customers can enable it with a single dashboard button, which ensures that all cacheable content is written to Cache Reserve.

content served from origin and getting cached in Cache Reserve, and Edge Cache Data Centers (T1=upper-tier, T2=lower-tier) on its way back to the client

It acts as the ultimate upper-tier cache, sitting between Cloudflare’s edge data centers and the origin. While the standard LRU-based cache handles the hottest content in local and upper-tier data centers, Cache Reserve provides a backstop for everything else.

How the Architecture Works

When a request comes in for content that isn't in the lower-tier or upper-tier caches, the network now has a third option before hitting the origin: Cache Reserve. It effectively collapses multiple concurrent cache misses from lower-tier data centers into a single request to the origin.

Consider a cold request for a piece of content that has never been seen before. The request hits a lower-tier data center and results in a miss. The lower-tier then checks with its mapped upper-tier, which also misses. Instead of immediately fanning out to the origin, the upper-tier asks Cache Reserve. Since Cache Reserve is the only component that can ask the origin for content, your origin only needs to serve that asset once before it is written to persistent storage. Subsequent requests from anywhere in the world can be served from this tier without further origin interaction.

This significantly limits the number of connections and requests that Cloudflare’s data centers need to open to your origin. It also means that control headers like cache-control and cdn-cache-control are still fully respected—the difference is that content won't be evicted early due to a lack of requests. If you need to update or invalidate content, purge requests are honored across both the standard cache and Cache Reserve.

Pricing and Availability

Cache Reserve is currently in closed beta. Interested users can sign up by navigating to the Caching tile in the dashboard and visiting the Cache Reserve page. The rollout will be gradual to allow for triaging edge cases before general availability.

Pricing will mimic R2’s low cost structure:

  • Storage: $0.015 per GB per month
  • Operations: $0.36 per million reads
  • Writes: $4.50 per million writes

By treating Cache Reserve as a complement to the existing Tiered Cache topology, Cloudflare offers a path toward that 100% target—ensuring that content is served from the edge persistently, shielding origins from unnecessary egress costs and improving response performance for visitors.