Cloudflare cuts tiered‑cache traffic by about 6% with Origin Range Requests
The new self‑service feature lets customers request only needed byte ranges, halving first‑byte latency for R2 and reducing overall cache traffic. It replaces a legacy range‑caching system that often fetched far more data than clients required.
A request for a few megabytes of a movie could previously prompt Cloudflare to fetch 128 MiB from the origin.1
A follow-up improvement reduced tiered-cache traffic for R2 and similar workloads by about 6%.1
Origin Range Requests is available as a self-service feature on all plans and is enabled with a Cache Rule.1
Story
How Cloudflare’s Origin Range Requests reshape large‑file deliveryPreviously, a request for a few megabytes of a movie could cause Cloudflare’s network to pull 128 MiB from the origin and move that data between data centers.1 That approach wasted both bandwidth and disk operations when serving large files at CDN scale.1 The revised cache implementation cut the p99 time‑to‑first‑byte for R2 by roughly half.1 A subsequent improvement lowered tiered‑cache traffic for R2 and similar workloads by about six percent.1 Cloudflare has packaged these changes into a feature called Origin Range Requests, available on all plans without contacting support.1
Origin Range Requests rely on the standard HTTP range request, which asks a server for a specific part of a resource rather than the whole file.1 Video players, download managers, package managers and clients that inspect the end of a file commonly use such range requests.1 Clients choose to issue a range request on their own, and Cloudflare forwards it unchanged.1 Before this feature, Cloudflare supported range‑request caching only through static zone configuration.1 That older system mapped each client request to fixed‑size file ranges, with the size and applicable file extensions set per zone.1
Small configured ranges could generate many origin requests and increase memory pressure.1 Conversely, large ranges could cause Cloudflare to fetch far more data than the client actually requested.1 Changing the old range size also invalidated cache entries because the size formed part of the cache key.1 The previous design allowed concurrent requests for different bytes within the same range block to block each other.1 Cloudflare’s nginx‑based cache could not combine range caching with concurrent streaming without truncating responses.1
Under the legacy system, each range had to finish downloading before it could be read, forcing a separate origin fetch for every range of a popular file.1 Moving from nginx to a Pingora‑based caching server made it possible to address these implementation problems.1 Pingora stores cached files on disk in fixed‑size chunks to support resuming interrupted downloads.1 When a range request arrives, Cloudflare checks which requested bytes are already cached, serves those, and fetches any missing bytes in ranges aligned to its fixed‑size chunk boundaries.1 Fetched bytes are stored in ordinary cache chunks, but only the bytes the client asked for are returned downstream.1
For example, a request for bytes 150‑250 can trigger a fetch of the aligned chunk that contains those bytes, while the response sent to the client remains limited to bytes 150‑250.1 Requests smaller than a cache chunk may still require Cloudflare to fetch the entire chunk that encloses the requested bytes.1 The extra work for non‑aligned ranges is bounded and predictable, rather than being set by a customer‑chosen range size.1 The coordinator examines asset headers and range‑coverage metadata, reads any available bytes, fetches missing coverage, records completed ranges, and assembles the final client response.1 A single response can therefore combine cached data, in‑flight fetches, and newly fetched bytes, even when the internal origin response exceeds the downstream range.1
If an existing download already covers bytes needed by another request, the second request can attach to the ongoing fetch instead of starting a new origin request.1 Cloudflare validates that composed bytes belong to the same representation by checking origin ranges, asset size stability, and consistent entity tags.1 When an If‑Range validator no longer matches, Cloudflare returns the full representation rather than mixing bytes from different versions.1 These safeguards ensure that clients receive a coherent file even when multiple overlapping range requests are processed concurrently.1 The overall effect is a more efficient use of origin bandwidth and reduced latency for end users.1
Customers enable Origin Range Requests through a Cache Rule, without needing to specify a range size.1 Because the feature does not alter the client’s original range request, existing video players and download managers continue to operate unchanged.1 The self‑service nature of the feature means it is available on all Cloudflare plans, simplifying adoption for both small sites and large enterprises.1 By eliminating the need to configure per‑zone range sizes, the new design avoids cache‑key invalidation that previously broke cached entries.1 Operators therefore see fewer cache misses and lower tiered‑cache traffic, as reflected in the six‑percent reduction reported.1
The shift to Pingora‑based caching also aligns Cloudflare’s architecture with modern edge computing requirements.1 Fixed‑size chunk storage supports resumable downloads and efficient range handling across diverse workloads.1 By fetching only the chunks needed to satisfy a range, Cloudflare reduces unnecessary origin traffic compared with the earlier 128 MiB fetches.1 The bounded extra work for misaligned ranges provides predictable performance, a key advantage for high‑traffic video streaming services.1 Overall, the feature demonstrates how a redesign of caching internals can yield measurable bandwidth savings and latency improvements.1
In summary, Origin Range Requests replace a rigid, size‑dependent caching model with a flexible, chunk‑based system that serves exactly the bytes clients ask for.1 The change cuts tiered‑cache traffic by about six percent and halves the p99 time‑to‑first‑byte for R2 workloads.1 Customers activate the feature via a simple Cache Rule, benefiting from reduced origin load without altering their existing client behavior.1 By leveraging Pingora’s chunk storage and intelligent range assembly, Cloudflare delivers large files more efficiently across its global network.1 The result is a measurable improvement in bandwidth utilization and user experience for any service that relies on large‑file delivery.1
Impact
Spreading outward, level by level- Level 1R2 response latency
Cloudflare says the revised cache implementation cut p99 time to first byte for R2 by about half.1
Fact - Level 2Tiered-cache traffic
A follow-up improvement reduced tiered-cache traffic for R2 and similar workloads by about 6%.1
Fact - Level 3Handling missing requested bytes
The system checks which requested bytes are cached, serves available bytes, and fetches missing coverage in ranges aligned to fixed-size cache chunks; fetched bytes are stored in ordinary chunks while the client receives only the bytes requested.1
Fact - Level 4Overlapping requests
When a download already covers bytes another request needs, that request can attach to the existing fetch instead of starting another origin fetch. This can reduce duplicate origin work during bursts of overlapping requests.
Analysis
Sources
What each source supportsWritten by AI from the sources listed below: every fact was checked word for word against its source, and inference is marked apart. How we write