Cloudflare can serve HTTP range requests from complete or partial cached files. Origin Range Requests let Cloudflare fetch eligible files from your origin in cache-aligned byte ranges.
Cloudflare uses the partial-file path only for a GET request that is eligible for caching when the request arrives. The origin response may later prove uncacheable. In that case, Cloudflare can still use origin range fetching, but does not store the response bytes.
HEAD requests and other methods do not use this path.
A HEAD request containing Range can return 200 OK, 206 Partial Content, 304 Not Modified, or 416 Range Not Satisfiable. A HEAD response never has a body. A 206 Partial Content response includes Content-Range. When Cloudflare serves a complete cached file without Origin Range Requests, a matching If-Range validator can preserve a 206 Partial Content response, while a mismatch returns 200 OK. Cloudflare ignores If-Range for other HEAD request paths.
A successful, unconditional GET without Range returns the complete file as 200 OK. On a cold cache miss, the first origin request also omits Range.
If only part of the file is cached, Cloudflare may request the missing bytes from the origin. The client still receives one complete 200 OK response.
The following requests return 206 Partial Content when successful:
Range: bytes=100-199Range: bytes=100-Range: bytes=-100
Cloudflare shortens an end position that exceeds the file size. A suffix range larger than the file returns the complete file as 206 Partial Content.
Cloudflare returns 416 Range Not Satisfiable for:
- An empty range, such as
bytes= - A zero-length suffix, such as
bytes=-0 - Inverted range bounds
- A range starting at or beyond the end of the file
- A range against an empty, uncompressed file
- Overlapping or out-of-order ranges when Origin Range Requests applies
A Cloudflare-generated 416 Range Not Satisfiable response has an empty body. It includes Content-Range: bytes */<FILE_SIZE>.
When Cloudflare serves a complete cached file without Origin Range Requests, it ignores overlapping or out-of-order ranges and normally returns the complete file as 200 OK.
Cloudflare processes the request as a non-range request when:
- The range syntax cannot be parsed
- The range unit is not
bytes - A number is too large to parse
- The header contains more than 300 ranges, or exactly 300 ranges when Cloudflare serves a complete cached file without Origin Range Requests
This normally returns the complete file as 200 OK. Conditional requests can return 304 Not Modified, and origin errors still apply.
When Origin Range Requests applies, between two and 300 valid, ascending, non-overlapping ranges return a multipart 206 Partial Content response. Cloudflare omits individual ranges that cannot be satisfied. The response remains multipart if only one range remains. If no ranges remain, Cloudflare returns 416 Range Not Satisfiable.
When Cloudflare serves a complete cached file without Origin Range Requests, one remaining satisfiable range produces a single-range 206 Partial Content response.
If-None-Match and If-Modified-Since take precedence over Range. They can produce a 304 Not Modified response.
Otherwise, an If-Range value that exactly matches the cached ETag or Last-Modified value preserves range behavior. A mismatch causes Cloudflare to ignore Range and use the complete-response path.
If Cloudflare must decompress a complete encoded response, it ignores Range. Cloudflare sends the complete, uncompressed body as 200 OK. This applies to cached responses and responses received from the origin.
A range request for an empty, encoded response returns an empty 200 OK, not 416 Range Not Satisfiable.
Cloudflare aligns origin range requests to 1 MiB cache boundaries. For example, if a client requests a 1 KiB range, Cloudflare may fetch a 1 MiB range from your origin and return only the requested 1 KiB to the client. Cloudflare may also split one client request into several single-range origin requests. The Range values seen by your origin can differ from the client's header. Consider this behavior when configuring origin logs, request limits, rate limits, or request signing.
Cloudflare adds Accept-Encoding: identity to every origin request generated by Origin Range Requests. This includes a complete-file GET handled by the feature. It does not disable normal compression between Cloudflare and the client.
For Cloudflare to cache an origin 206 Partial Content response, the response must meet these requirements:
| Response field | Requirement |
|---|---|
Content-Encoding |
The response must be unencoded. |
Content-Range |
Include a concrete range. Its start must match Cloudflare's request. Its end must match the requested end or the end of the file, whichever comes first. Include the complete file size. |
Content-Length |
Include a numeric value equal to the returned interval length. |
Transfer-Encoding |
Omit this header. |
ETag |
Optional. If present, its presence and exact value must remain consistent across responses for the same cached representation. |
The complete file size must also remain consistent across responses. Violations can prevent caching or end responses served to the client early.
If the origin ignores a Cloudflare-generated Range header and returns a complete 200 OK, Cloudflare can use the response. Cloudflare must download the complete file and may then return the requested range to the client.
If the origin returns an encoded 206 Partial Content response, Cloudflare does not cache it. Before the client response starts, Cloudflare may send that single response without caching. After the response starts, Cloudflare ends it early, and the client receives fewer bytes than promised.
Other incompatible origin responses during a response assembled from several requests can also end the client response early.
Origin Range Requests do not make an otherwise ineligible request or response cacheable. Cloudflare checks the maximum cacheable file size against the complete size from Content-Range. Requesting a small range does not bypass this limit.
Origin Range Requests are not supported with Cache Reserve.