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

Tempo di lettura: 2 min
Tempo di lettura stimato: 2 min

Punti Chiave dell'Evento (In Breve)

  • A video player seeking to the middle of a movie asks for a few megabytes.
  • Under our old range caching, that one request could make Cloudflare pull 128 MiB from the origin and move it between data centers, sometimes after the viewer had already left.
  • Range requests are how large files get delivered, and caching them naively easily leads to wasted network bandwidth and wasted disk operations when running a CDN at scale.

Origin Range Requests: Serving large files without range-request tuning — Rassegna informativa e sintesi tecnica curata da PCNext sulla base del report documentato da Cloudflare Blog.

Sintesi della Notizia & Quadro dell’Evento

A video player seeking to the middle of a movie asks for a few megabytes. Under our old range caching, that one request could make Cloudflare pull 128 MiB from the origin and move it between data centers, sometimes after the viewer had already left. Range requests are how large files get delivered, and caching them naively easily leads to wasted network bandwidth and wasted disk operations when running a CDN at scale.

So we rebuilt how our cache handles them. For R2, Cloudflare's object storage, p99 time to first byte dropped by about half, and a follow-up improvement cut tiered cache traffic for R2 and similar workloads by about 6%.

Dettagli Tecnici & Approfondimento

Today, we're making that new implementation available as Origin Range Requests , a self-service feature on all plans. There's no range size to tune and no need to contact support. Turn it on with a Cache Rule , and Cloudflare handles the rest.

An HTTP range request asks for part of a resource instead of the whole resource. The client sends a normal GET with a Range header:

HTTP/1.1 206 Partial Content Content-Range: bytes 1048576-2097151/524288000 Content-Length: 1048576 Range requests are common for large objects. A video player can request bytes around a seek position instead of the whole file. A download manager can resume after an interruption. A package manager can fetch part of an artifact. A client can inspect the end of a file without downloading everything before it.