I was a bit confused what this adds other than just standard CDN-Cache-Control page caching that we do now. Some quirks I've found;
- You still get billed per request, whether the request hits cache or not (but don't get billed for CPU time)
- You now get billed for static asset requests! This makes no sense to me. "One thing to watch: when caching is enabled, requests that are normally free — static asset requests and worker-to-worker invocations through service bindings or ctx.exports — are billed at the standard request rate, because each one now consults the cache in front of your Worker." Yeah that sounds like a bug that just happens to generate them more money.
- The cache key automatically has the worker deployment version, so even gradual deployments populate their own cache which is nice
- It seems like you can set a totally custom cache key? But that was previously Enterprise only, can't see if that's still the case here.
> Yeah that sounds like a bug that just happens to generate them more money.
Yeah. It sounds like they moved the component that counts requests earlier in the pipeline so that it can count cache hits, and now it also counts these.
CPU time is not billed
> I was a bit confused what this adds other than just standard CDN-Cache-Control page caching that we do now.
Until now these cache headers didn't work if you set them in a Worker, because Workers were always run in front of the cache. You could use them if you're running Cloudflare cache in front of another origin, but not if you were e.g. rendering a site in Workers. This changes that.