Confused about Caching with Fetch API within Workers
I would like to cache requests made from the Workers Fetch API in the Tiered Cache, which can then be periodically purged globally by URL.
This page (https://developers.cloudflare.com/workers/learning/how-the-cache-works/#interacting-with-the-cloudflare-cache) says that all fetches are cached automatically, IF they are proxied through Cloudflare. And the caching can be further customized by operating on the
However, my question is whether it would get cached if I
a) do not own the site, and/or
b) it is not an active zone on Cloudflare
I ask this because in this section (https://developers.cloudflare.com/workers/learning/how-the-cache-works/#single-file-purge--assets-cached-by-a-worker) of the same Workers Cache documentation, it shows a decision tree for cache purging.
Surely I'm missing something fundamental about how this all works. I hope someone can clarify for me!
This page (https://developers.cloudflare.com/workers/learning/how-the-cache-works/#interacting-with-the-cloudflare-cache) says that all fetches are cached automatically, IF they are proxied through Cloudflare. And the caching can be further customized by operating on the
cf object, as in this example https://developers.cloudflare.com/workers/examples/cache-using-fetch/However, my question is whether it would get cached if I
a) do not own the site, and/or
b) it is not an active zone on Cloudflare
I ask this because in this section (https://developers.cloudflare.com/workers/learning/how-the-cache-works/#single-file-purge--assets-cached-by-a-worker) of the same Workers Cache documentation, it shows a decision tree for cache purging.
- If the page is not an active CF zone, it can be purged (but how was it cached to begin with?)
- If it is an active CF zone, but not proxied, it can be purged (again, how was it cached to begin with?)
- If it is proxied and you own it, you can purge it
- If you do not own it, it cannot be purged
Surely I'm missing something fundamental about how this all works. I hope someone can clarify for me!