Skip to content
AnswerWell geo Documentation

Research · 7 min read · Answerwell

HTTP Range Requests: Partial Content, Caching and Origin Behavior

How Range headers produce 206 and 416 responses, how a CDN caches partial fetches, and how to configure origin range requests.

This page summarises Cloudflare documentation on HTTP Range requests: when clients receive 206 Partial Content or 416 Range Not Satisfiable, how caching and conditional requests interact, and how Origin Range Requests in Cache Rules settings change what your origin sees. Related status-code definitions come from Cloudflare’s 2xx Success and 4xx Client Error references.

206 Partial Content: what a byte-range response means

Section titled “206 Partial Content: what a byte-range response means”

A 206 response means the request was only partly fulfilled—typically when the client asked for a slice of a large file (video seeking, resume downloads, progressive loading).

A 206 response means that the request was partially successful, often used for serving large files in smaller chunks.

— Cloudflare, 2xx Success

The response either carries a single interval with Content-Range, or a multipart body when several non-overlapping ranges are satisfied. Cloudflare documents valid single-range forms such as Range: bytes=100-199, bytes=100-, and bytes=-100 (suffix ranges) in Range request behavior.

Client Range requests: how the edge serves bytes

Section titled “Client Range requests: how the edge serves bytes”

Cloudflare can answer Range on GET from a full or partial cache entry. Eligibility depends on method, range syntax, conditional headers, content encoding, and whether the response is cacheable—see Default cache behavior and the full rules in Range request behavior.

When does Cloudflare return 200 OK instead of 206?

Section titled “When does Cloudflare return 200 OK instead of 206?”

An unconditional GET without Range returns the whole object as 200 OK. On a cache miss the first origin fetch also omits Range. If only part of the file is cached, Cloudflare may still fetch missing bytes from the origin and deliver one complete 200 OK to the client.

Cloudflare treats some Range headers as absent: unparseable syntax, non-bytes units, numbers too large to parse, or more than 300 ranges (or exactly 300 when serving a complete cached file without Origin Range Requests). Those requests normally get the full file as 200 OK, though conditional validators can still yield 304 Not Modified.

If Cloudflare must decompress an encoded cached or origin response, it ignores Range and sends the full uncompressed body as 200 OK. A range request against an empty encoded object returns empty 200 OK, not 416.

One range, multiple ranges, and unsatisfiable bytes

Section titled “One range, multiple ranges, and unsatisfiable bytes”

With Origin Range Requests enabled for eligible traffic, two through 300 valid ascending non-overlapping ranges can produce a multipart 206; invalid ranges in the set may be dropped. With a complete cached file and Origin Range Requests off, overlapping or out-of-order client ranges are usually ignored and the full file is returned as 200 OK.

Cloudflare returns 416 Range Not Satisfiable for cases such as empty bytes=, inverted bounds, ranges starting at or beyond the file end, and some multi-range failures when Origin Range Requests applies. A Cloudflare-generated 416 has an empty body and Content-Range: bytes */<FILE_SIZE>.

The 416 Range Not Satisfiable status code indicates that the server cannot fulfill the byte range specified in the request’s Range header.

— Cloudflare, Error 416

Cloudflare may generate 416 when a cached resource cannot satisfy the range; it does not cache origin 416 responses, so one bad range request does not poison later responses for the same URL.

Conditional validators take precedence over Range:

If-None-Match and If-Modified-Since take precedence over Range. They can produce a 304 Not Modified response.

— Cloudflare, Range request behavior

Otherwise, If-Range that exactly matches cached ETag or Last-Modified preserves range handling; a mismatch drops Range and uses the complete-response path. For HEAD with Range, responses may be 200, 206, 304, or 416 without a body; 206 still includes Content-Range.

Origin Range Requests: cache-aligned fetches from your origin

Section titled “Origin Range Requests: cache-aligned fetches from your origin”

Origin Range Requests let Cloudflare pull large objects from the origin in cache-aligned byte ranges instead of always downloading the entire file on a small client range.

Origin Range Requests let Cloudflare fetch large files from your origin in cache-aligned byte ranges. Cloudflare may expand a client range and issue several single-range origin requests. Your origin may receive ranges that differ from the client’s Range header.

— Cloudflare, Available settings

Important limits from the same sources:

Topic Behavior
Cache eligibility The setting does not make a request or response cacheable by itself.
File size limits Apply to the complete object size from Content-Range, not the client’s slice.
Cache Reserve Not supported with Origin Range Requests.
Origin encoding Cloudflare sends Accept-Encoding: identity on origin range fetches; client compression is unchanged.
Alignment Origin requests align to 1 MiB boundaries; a 1 KiB client range may trigger a 1 MiB origin fetch.

If the origin ignores Range and returns full 200 OK, Cloudflare can still use the response but must download the entire file—then it may return only the client’s range.

Configure via Cache Rules (dashboard or Rulesets API). The mode property is required:

mode Effect
on Cloudflare may generate origin range requests for matching eligible GETs.
off No generated origin range requests; ranges can still be served from a fully cached file.
default No rule override; platform default (no extensions on by default).

Example to enable caching and origin ranges (from Available settings):

"action_parameters": {
"cache": true,
"origin_range_requests": {
"mode": "on"
}
}

Global opt-out without changing cache eligibility (Configure Origin Range Requests with the Rulesets API):

{
"expression": "true",
"action": "set_cache_settings",
"action_parameters": {
"origin_range_requests": {
"mode": "off"
}
}
}

off only stops generated origin range requests. On a cacheable miss Cloudflare may still strip the client Range and fetch the complete file; if caching is bypassed it may forward the client’s original Range header.

What your origin must return for cacheable 206

Section titled “What your origin must return for cacheable 206”

For Cloudflare to store an origin 206, the partial response must be unencoded, include matching Content-Range and Content-Length, omit Transfer-Encoding, and keep consistent total file size (and ETag if present) across responses—see the requirement table in Range request behavior. Encoded origin 206 responses are not cached; incompatible multi-part assembly can end the client response early.

For Workers Caching, you normally return a full 200 and let the platform slice ranges:

When a client sends a Range request, Cloudflare strips the Range header before invoking your Worker and asks your Worker for the full body. Your Worker returns a normal 200 response with a Cache-Control header (as it would for any other request), Cloudflare stores that full response, and then slices out the requested byte range and returns it to the client as a 206 Partial Content response (or 416 Range Not Satisfiable if the range is invalid).

— Cloudflare, Workers cache configuration

Follow-up range requests on the same URL can be cache HITs without re-invoking the Worker.

If the Worker returns its own 206, Workers Caching treats it as uncacheable (Workers cache limitations). That matches the guidance to return full 200 responses and let Workers Caching handle slicing.

Cloudflare Pages currently responds with 200 for browser Range requests on assets, with spec-compliant 206 called out as in progress; it still sends ETag and can answer validators with 304 Not Modified.

For R2 in Workers, R2GetOptions accepts range as offset/length, length-only, or suffix—useful when your Worker (not the CDN cache layer) performs explicit ranged object reads.

Service worker caches: Workbox RangeRequestsPlugin

Section titled “Service worker caches: Workbox RangeRequestsPlugin”

In the browser, a cached full response often ignores incoming Range. Google’s workbox-range-requests module reads the cached body and returns the requested slice, yielding 206 or 416 via createPartialResponse(). If the cached response is already 206, the helper assumes range handling is done and returns it unchanged. That pattern is separate from CDN edge behavior but solves the same user-facing problem (e.g. video seek on a cached asset).

  • Returning 206 from a Worker while expecting Workers Caching to store the object—return 200 with full body instead (Workers cache configuration).
  • Assuming a small client range equals a small origin request—1 MiB alignment and request splitting can inflate origin traffic (Range request behavior).
  • Serving compressed partial responses from origin—origin range fetches use identity; encoded 206 from origin won’t cache as intended.
  • Ignoring If-None-Match / If-Modified-Since—they override Range and may return 304 before any partial logic runs.
  • Expecting Origin Range Requests to enable caching for otherwise uncacheable content—it does not (Available settings).
  1. Request a known large static URL with curl -I -H 'Range: bytes=0-99' https://your-host/path/to/file and confirm 206, Content-Range, and sensible Content-Length for the interval (Range request behavior).

  2. Repeat with an invalid range (e.g. bytes=999999999-) and confirm 416 with Content-Range: bytes */<size> when served by Cloudflare (Error 416).

  3. Send conditional GET with matching If-None-Match from a prior ETag and verify 304 takes precedence over Range when both are present.

  4. If you use Workers Caching, compare Cf-Cache-Status on first vs second Range request to the same URL and confirm the Worker is not re-run on cache hit (Workers cache configuration).

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact sentence you are asking about.