Is the worker cache (using the fetch API) 'private'?
Hi there - looking at how to cache a request serverside so we don't query more often than we need to - and ran into this in the docs: https://developers.cloudflare.com/workers/examples/cache-using-fetch/
Are these caches 'private'? As in - can anyone hit them and are they suitable for holding personal data? A little bit confused in how it's different from the other cache API https://developers.cloudflare.com/workers/runtime-apis/cache/
Thanks so much, Ollie
1 Reply
Yes. The Workers Cache API shares the same underlying cache as the Zone-level cache that you can enable for non-Workers origins.
For example, if you cache a response from
https://google.com on a Worker on https://foo.bar, all Workers responding on your account on https://foo.bar will be able to read that cached entry. However, if I have a Worker on https://bar.baz, and I fetch https://google.com, I wouldn't see the objects you pushed to the cache