How to make cache.put to all data centers

For Workers & Pages, what is the name of the domain?

readtoinvest-cloudflare-worker.marcin.workers.dev

What is the issue or error you’re encountering

cache not retrieved when checking cache from a different location.

What are the steps to reproduce the issue?

I use a worker as a proxy to cache a response using cache.put() from a server but learned that it is cached only locally on a nearby data center.

How could I cache it across all data centers to avoid making the same requests to the server from different user locations?

Should I cache the responses in a different way?

Cache API only stores locally:
https://developers.cloudflare.com/workers/reference/how-the-cache-works/#cache-api

If you want to avoid making repeated requests to your server, you would have to cache via fetch(), and enable Tiered Caching (Smart Topology):

https://developers.cloudflare.com/workers/reference/how-the-cache-works/#fetch

https://developers.cloudflare.com/cache/how-to/tiered-cache/#smart-tiered-cache

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.