Is the Cache API copied to multiple PoPs?

If a worker executes in a PoP and puts something into the cache API and then a user executes the same worker on another PoP will the worker access the same cache or fetch from origin?

1 Like

:wave: @pier,

Caching is done based on plan type. In general cache is per colo. For enterprise customers there is also tiered caching. There’s nothing special/ intrinsic to a works based cache put vs a normal request for a catchable object.

— OG


Thanks @OliverGrant

I thought the cache API and the regular CDN cache were two different things.

1 Like

For globally distributed “cache” you could build something around Workers KV with expiring keys, where you store your fetch on a KV pair and then move to the cache or global variable, saving cost of KV.

1 Like

Thanks. Yes I’m doing this for other stuff. I was wondering if it would be better to simply use the cache api.

This is the part from the docs that confused me @OliverGrant about the cache API:

Though this cache object persists on all of Cloudflare’s data centers, objects are not replicated to any other data centers. Note this individualized zone cache object differs from Cloudflare’s Global CDN

As I understand it now is that the behavior is the same (cache is not replicated in either method) but the stored object is different between the two caches.