Chapter 04 · Cloudflare Deploy
Subchapter 4.59
references/cache-reserve/gotchas.mdMarkdown6 KBView on GitHub
Cause: Asset is not cacheable, TTL < 10 hours, Content-Length header missing, or blocking headers present (Set-Cookie, Vary: *)
Solution: Ensure minimum TTL of 10+ hours (Cache-Control: public, max-age=36000), add Content-Length header, remove Set-Cookie header, and set Vary: Accept-Encoding (not *)
Cause: Cache Reserve does NOT support range requests (HTTP 206 Partial Content)
Solution: Range requests bypass Cache Reserve entirely. For video streaming with seeking:
Cause: Cache Reserve fetches uncompressed content from origin, even though it serves compressed to visitors
Solution:
Cause: Cloudflare Images with Vary: Accept header (format negotiation) is incompatible with Cache Reserve
Solution:
Cause: Frequent cache misses, short TTLs, or frequent revalidation
Solution: Increase TTL for stable content (24+ hours), enable Tiered Cache to reduce direct Cache Reserve misses, or use stale-while-revalidate
Cause: Purge by tag only triggers revalidation but doesn’t remove from Cache Reserve storage
Solution: Use purge by URL for immediate removal, or disable Cache Reserve then clear all data for complete removal
Cause: Orange-to-Orange (proxied zone requesting another proxied zone on Cloudflare) bypasses Cache Reserve
Solution:
cf-cache-status for BYPASS and review request pathCause: Attempting to clear Cache Reserve data while it’s still enabled
Solution: Disable Cache Reserve first, wait briefly for propagation (5s), then clear data (can take up to 24 hours)
| Limit | Value | Notes |
|---|---|---|
| Minimum TTL | 10 hours (36000 seconds) | Assets with shorter TTL not eligible |
| Default retention | 30 days (2592000 seconds) | Configurable |
| Maximum file size | Same as R2 limits | No practical limit |
| Purge/clear time | Up to 24 hours | Complete propagation time |
| Plan requirement | Paid Cache Reserve or Smart Shield | Not available on free plans |
| Content-Length header | Required | Must be present for eligibility |
| Set-Cookie header | Blocks caching | Must not be present (or use private directive) |
| Vary header | Cannot be * | Can use Vary: Accept-Encoding |
| Image transformations | Variants not eligible | Original images only |
| Range requests | NOT supported | HTTP 206 bypasses Cache Reserve |
| Compression | Fetches uncompressed | Serves compressed to visitors |
| Worker control | Zone-level only | Cannot control per-request |
| O2O requests | Bypassed | Orange-to-Orange not eligible |
Asset not caching in Cache Reserve?
1. Is Cache Reserve enabled for zone?
→ No: Enable via Dashboard or API
→ Yes: Continue to step 2
2. Is Tiered Cache enabled?
→ No: Enable Tiered Cache (required!)
→ Yes: Continue to step 3
3. Does asset have TTL ≥ 10 hours?
→ No: Increase via Cache Rules (edge_ttl override)
→ Yes: Continue to step 4
4. Is Content-Length header present?
→ No: Fix origin to include Content-Length
→ Yes: Continue to step 5
5. Is Set-Cookie header present?
→ Yes: Remove Set-Cookie or scope appropriately
→ No: Continue to step 6
6. Is Vary header set to *?
→ Yes: Change to specific value (e.g., Accept-Encoding)
→ No: Continue to step 7
7. Is this a range request?
→ Yes: Range requests bypass Cache Reserve (not supported)
→ No: Continue to step 8
8. Is this an O2O (Orange-to-Orange) request?
→ Yes: O2O bypasses Cache Reserve
→ No: Continue to step 9
9. Check Logpush CacheReserveUsed field
→ Filter logs to see if assets ever hit Cache Reserve
→ Verify cf-cache-status header (should be HIT after first request)