I’ve been spending the last two days diving heavily into Cloudflare and have been struggling with getting static resources to cache. No matter what I do, I’ve never seen a CF-Cache-Status header.
I’m using Cloudflare Workers to host a super-simple website (still learning this platform). I’ve tried using Page Rules to turn Origin Cache Control on or off, and I’ve tried every combination of max-age and/or s-maxage headers imaginable but I’ve gotten nowhere.
Websites directly served from Workers do not have cf-cache-status header. Caching will not be involved if you serve your websites from Workers - even if you can cache, each incoming request (no matter cached or uncached) will still count as one Workers request.
Um, that’s really misleading considering all the documentation related to caching in the Workers documentation. Also, this was written by Cloudflare and it supposedly caches static content in the CDN despite serving out of a worker: @cloudflare/kv-asset-handler - npm
Can you clarify further? If this is all true, I feel like I wasted 2 days worth of time.
I would strongly recommend mentioning that article in early onboarding documentation to save folks from having to go through all the digging I did. Your documentation is good when you can find what you’re looking for, but the contradictory nature of one article vs the next can feel very frustrating at times. Hope this helps save someone else some time.