Repository navigation
Conversation
…range request behavior
AI Review✅ Reviewed 👉 Fix in your agent 👈Fix the following review findings in PR #34919 (https://github.com/cloudflare/cloudflare-docs/pull/34919).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification.
- If you disagree, explain why.
- If you need clarification before deciding, ask those questions.
- Then share your plan for which issues to tackle and in what order.
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit because the next review reads PR comments.
## Style Guide
- S-16570759 | src/content/docs/cache/reference/range-requests.mdx:1 | File content replaced with `[object Object]`
The PR deletes the entire page (frontmatter with `title`/`description`/`pcx_content_type`, plus all reference sections) and leaves a single line of `[object Object]`, a serialization artifact rather than documentation. Reading the file at the PR head confirms its full contents are just `[object Object]`, so none of the three documented additions are present and the page would render as broken content.Style GuideSkipped: no new docs content changes since the last review.
Commands
|
Review coverage✅ The ownership area is covered. ✅ 1 area already covered
CODEOWNERS mappings for displayed areas (1)
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://ngayerie-cache-range-requests-behavior-notes.previews.developers.cloudflare.com (commit 22e9c1d)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
|
Worker Preview URL: https://gh-ngayerie-cache-range-requests-behavior-notes.previews.developers.cloudflare.com Files with changes (up to 15) |
|
Hi @zaidoon1 , @mbullock1986 , @ack-cf |
neelakolkar-cf
left a comment
There was a problem hiding this comment.
@ngayerie Please resolve the comment threads and merge the PR once done, all approved.
|
Hi @zaidoon1 |
| - 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 | ||
| - The header contains more than 300 ranges, or exactly 300 ranges when Cloudflare serves a complete file without Origin Range Requests |
There was a problem hiding this comment.
Cloudflare now accepts up to 500 ranges, not 300. This also puts back "complete cached file". The last commit changed it only here, and lines 19, 52 and 69 use the same phrase for this path. Line 67 needs the same number: "between two and 500 valid, ascending, non-overlapping ranges".
| - The header contains more than 300 ranges, or exactly 300 ranges when Cloudflare serves a complete file without Origin Range Requests | |
| - The header contains more than 500 ranges, or exactly 500 ranges when Cloudflare serves a complete cached file without Origin Range Requests |
| To check whether your origin supports range requests, send a range request directly to your origin. A request through a proxied hostname can return `206 Partial Content` from Cloudflare even when your origin ignores `Range`. | ||
|
|
||
| ```sh | ||
| curl https://example.com/large-file.mp4 --include --resolve example.com:443:<ORIGIN_IP> --header "Range: bytes=0-1" --header "Accept-Encoding: identity" | ||
| ``` | ||
|
|
||
| A `206 Partial Content` response with `Content-Range: bytes 0-1/<FILE_SIZE>` shows that your origin supports range requests. Check that the response also meets the [partial response requirements](#partial-response-requirements). A `200 OK` response means that your origin ignores `Range`. |
There was a problem hiding this comment.
--resolve needs an IP address, but many origins are hostnames. --connect-to takes either. curl also rejects an Origin CA certificate unless you pass --insecure. Cloudflare asks the origin for 1 MiB-aligned ranges, so testing 1 MiB also catches an origin that shortens long ranges or sends them chunked. A 2-byte range passes both.
| To check whether your origin supports range requests, send a range request directly to your origin. A request through a proxied hostname can return `206 Partial Content` from Cloudflare even when your origin ignores `Range`. | |
| ```sh | |
| curl https://example.com/large-file.mp4 --include --resolve example.com:443:<ORIGIN_IP> --header "Range: bytes=0-1" --header "Accept-Encoding: identity" | |
| ``` | |
| A `206 Partial Content` response with `Content-Range: bytes 0-1/<FILE_SIZE>` shows that your origin supports range requests. Check that the response also meets the [partial response requirements](#partial-response-requirements). A `200 OK` response means that your origin ignores `Range`. | |
| To check whether your origin supports range requests, send a range request directly to your origin. A request through a proxied hostname can return `206 Partial Content` from Cloudflare even when your origin ignores `Range`. Cloudflare requests ranges aligned to 1 MiB, so test with the first 1 MiB of a file larger than 1 MiB. | |
| ```sh | |
| curl https://example.com/large-file.mp4 --connect-to example.com:443:<ORIGIN_ADDRESS>:443 --header "Range: bytes=0-1048575" --header "Accept-Encoding: identity" --dump-header - --output /dev/null | |
| ``` | |
| Replace `<ORIGIN_ADDRESS>` with your origin's IP address or hostname. If your origin uses a [Cloudflare Origin CA certificate](/ssl/origin-configuration/origin-ca/), add `--insecure`, because curl does not trust that certificate. | |
| A `206 Partial Content` response with `Content-Range: bytes 0-1048575/<FILE_SIZE>` and `Content-Length: 1048576` shows that your origin supports range requests. Check that the response also meets the [partial response requirements](#partial-response-requirements). A `200 OK` response means that your origin ignores `Range`. |
There was a problem hiding this comment.
[AI] Fixed — applied your suggestion verbatim: switched to --connect-to, changed range to bytes=0-1048575, replaced --include with --dump-header - --output /dev/null, added the <ORIGIN_ADDRESS> replacement note and --insecure callout for Origin CA certs. Success condition updated to Content-Range: bytes 0-1048575/<FILE_SIZE> and Content-Length: 1048576.
| Origin Range Requests do not make an otherwise ineligible request or response cacheable. Cloudflare checks the [maximum cacheable file size](/cache/concepts/default-cache-behavior/#cacheable-size-limits) 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](/cache/advanced-configuration/cache-reserve/#limits). | ||
| Changing the Origin Range Requests setting does not change the cache key or purge cached files. Cloudflare records which byte ranges of a file are cached alongside the file. Files cached in full remain usable either way. After you turn the setting off, Cloudflare stops serving files it holds only in part. The next request for such a file fetches the complete file again and replaces the partial copy. |
There was a problem hiding this comment.
This covers turning the setting off. Turning it on has a case too. Requests made while it was off don't ask for identity, so a file cached then can be stored gzip- or Brotli-encoded. That copy stays usable, but its ranges follow the Decompression rules rather than the partial-file path this page describes.
| Changing the Origin Range Requests setting does not change the cache key or purge cached files. Cloudflare records which byte ranges of a file are cached alongside the file. Files cached in full remain usable either way. After you turn the setting off, Cloudflare stops serving files it holds only in part. The next request for such a file fetches the complete file again and replaces the partial copy. | |
| Changing the Origin Range Requests setting does not change the cache key or purge cached files. Cloudflare records which byte ranges of a file are cached alongside the file. Files cached in full remain usable either way. After you turn the setting off, Cloudflare stops serving files it holds only in part. The next request for such a file fetches the complete file again and replaces the partial copy. After you turn the setting on, a file already cached with a `Content-Encoding` keeps that encoding, and range requests for it follow [Decompression](#decompression). To fetch it unencoded with Origin Range Requests, [purge](/cache/how-to/purge-cache/) it. |
There was a problem hiding this comment.
[AI] Fixed — applied your suggestion verbatim. Added the turn-on case: files already cached with a Content-Encoding keep that encoding after enabling the feature, their range requests follow the Decompression path, and users need to purge to get an unencoded copy.
|
[AI] Merge conflict resolved — rebased onto current production, which includes #35559's |
…Uncached range requests
Adds three pieces of practical information to the range request behavior reference page, sourced from internal documentation that was not previously reflected in public docs.
curltest snippet so users can confirm their origin returns206before enabling Origin Range RequestsDEE-4070