Origin Range Requests: Serving large files without range-request tuning

Cloudflare's old range-request caching sliced files into a per-zone configured range size, so a small video seek could pull 128 MiB from origin for R2, while small ranges caused floods of tiny origin requests and memory pressure, and concurrent requests in the same range blocked each other. Moving from nginx to its Pingora-based cache, it reused Pingora's fixed-size on-disk chunks as the unit: a coordinator serves cached bytes, attaches to in-flight downloads, fetches only missing chunk-aligned ranges from origin, and validates size and ETag before composing one 206 response. For R2, p99 time to first byte dropped by about half, and letting one response combine disk and upstream bytes cut tiered cache traffic about 6% week over week.

Published
2026-10-23
Scale
R2 p99 time to first byte roughly halved (hits and misses), ~6% less tiered cache traffic for R2-like workloads, petabytes/day, old configured range sizes from tens of KB to tens of GB, R2 previously used 64 MiB ranges (up to 128 MiB per small read)
Techniques
caching request coalescing tiered storage
Stack
Pingora R2 Tiered Cache

See also

The best scaling write-ups, weekly

One email a week. No spam.