Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/cache-reserve/gotchas.md
1# Cache Reserve Gotchas23## Common Errors45### "Assets Not Being Cached in Cache Reserve"67**Cause:** Asset is not cacheable, TTL < 10 hours, Content-Length header missing, or blocking headers present (Set-Cookie, Vary: *)8**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 *)910### "Range Requests Not Working" (Video Seeking Fails)1112**Cause:** Cache Reserve does **NOT** support range requests (HTTP 206 Partial Content)13**Solution:** Range requests bypass Cache Reserve entirely. For video streaming with seeking:14- Use edge cache only (shorter TTLs)15- Consider R2 with direct access for range-heavy workloads16- Accept that seekable content won't benefit from Cache Reserve persistence1718### "Origin Bandwidth Higher Than Expected"1920**Cause:** Cache Reserve fetches **uncompressed** content from origin, even though it serves compressed to visitors21**Solution:**22- If origin charges by bandwidth, factor in uncompressed transfer costs23- Cache Reserve compresses for visitors automatically (saves visitor bandwidth)24- Compare: origin egress savings vs higher uncompressed fetch costs2526### "Cloudflare Images Not Caching with Cache Reserve"2728**Cause:** Cloudflare Images with `Vary: Accept` header (format negotiation) is incompatible with Cache Reserve29**Solution:**30- Cache Reserve silently skips images with Vary for format negotiation31- Original images (non-transformed) may still be eligible32- Use Cloudflare Images variants or edge cache for transformed images3334### "High Class A Operations Costs"3536**Cause:** Frequent cache misses, short TTLs, or frequent revalidation37**Solution:** Increase TTL for stable content (24+ hours), enable Tiered Cache to reduce direct Cache Reserve misses, or use stale-while-revalidate3839### "Purge Not Working as Expected"4041**Cause:** Purge by tag only triggers revalidation but doesn't remove from Cache Reserve storage42**Solution:** Use purge by URL for immediate removal, or disable Cache Reserve then clear all data for complete removal4344### "O2O (Orange-to-Orange) Assets Not Caching"4546**Cause:** Orange-to-Orange (proxied zone requesting another proxied zone on Cloudflare) bypasses Cache Reserve47**Solution:**48- **What is O2O**: Zone A (proxied) → Zone B (proxied), both on Cloudflare49- **Detection**: Check `cf-cache-status` for `BYPASS` and review request path50- **Workaround**: Use R2 or direct origin access instead of O2O proxy chains5152### "Cache Reserve must be OFF before clearing data"5354**Cause:** Attempting to clear Cache Reserve data while it's still enabled55**Solution:** Disable Cache Reserve first, wait briefly for propagation (5s), then clear data (can take up to 24 hours)5657## Limits5859| Limit | Value | Notes |60|-------|-------|-------|61| Minimum TTL | 10 hours (36000 seconds) | Assets with shorter TTL not eligible |62| Default retention | 30 days (2592000 seconds) | Configurable |63| Maximum file size | Same as R2 limits | No practical limit |64| Purge/clear time | Up to 24 hours | Complete propagation time |65| Plan requirement | Paid Cache Reserve or Smart Shield | Not available on free plans |66| Content-Length header | Required | Must be present for eligibility |67| Set-Cookie header | Blocks caching | Must not be present (or use private directive) |68| Vary header | Cannot be * | Can use Vary: Accept-Encoding |69| Image transformations | Variants not eligible | Original images only |70| Range requests | NOT supported | HTTP 206 bypasses Cache Reserve |71| Compression | Fetches uncompressed | Serves compressed to visitors |72| Worker control | Zone-level only | Cannot control per-request |73| O2O requests | Bypassed | Orange-to-Orange not eligible |7475## Additional Resources7677- **Official Docs**: https://developers.cloudflare.com/cache/advanced-configuration/cache-reserve/78- **API Reference**: https://developers.cloudflare.com/api/resources/cache/subresources/cache_reserve/79- **Cache Rules**: https://developers.cloudflare.com/cache/how-to/cache-rules/80- **Workers Cache API**: https://developers.cloudflare.com/workers/runtime-apis/cache/81- **R2 Documentation**: https://developers.cloudflare.com/r2/82- **Smart Shield**: https://developers.cloudflare.com/smart-shield/83- **Tiered Cache**: https://developers.cloudflare.com/cache/how-to/tiered-cache/8485## Troubleshooting Flowchart8687Asset not caching in Cache Reserve?8889```901. Is Cache Reserve enabled for zone?91→ No: Enable via Dashboard or API92→ Yes: Continue to step 293942. Is Tiered Cache enabled?95→ No: Enable Tiered Cache (required!)96→ Yes: Continue to step 397983. Does asset have TTL ≥ 10 hours?99→ No: Increase via Cache Rules (edge_ttl override)100→ Yes: Continue to step 41011024. Is Content-Length header present?103→ No: Fix origin to include Content-Length104→ Yes: Continue to step 51051065. Is Set-Cookie header present?107→ Yes: Remove Set-Cookie or scope appropriately108→ No: Continue to step 61091106. Is Vary header set to *?111→ Yes: Change to specific value (e.g., Accept-Encoding)112→ No: Continue to step 71131147. Is this a range request?115→ Yes: Range requests bypass Cache Reserve (not supported)116→ No: Continue to step 81171188. Is this an O2O (Orange-to-Orange) request?119→ Yes: O2O bypasses Cache Reserve120→ No: Continue to step 91211229. Check Logpush CacheReserveUsed field123→ Filter logs to see if assets ever hit Cache Reserve124→ Verify cf-cache-status header (should be HIT after first request)125```126127## See Also128129- [README](./README.md) - Overview and core concepts130- [Configuration](./configuration.md) - Setup and Cache Rules131- [API Reference](./api.md) - Purging and monitoring132- [Patterns](./patterns.md) - Best practices and optimization133