How to delete/purge via API the Workers Cache API?

Hi!
The Workers Cache API caches stuff only on the specific data center where it is created, it’s NOT available globally.

The Cache API is available globally but the contents of the cache do not replicate outside of the originating data center. A GET /users response can be cached in the originating data center, but will not exist in another data center unless it has been explicitly created.

And therefore, deleting the Cache ( cache.delete(request, options) ), is ONLY possible with a worker in that specific data center; the problem: we can’t choose workers LOL workers are always picked randomly.

So, how can I delete/purge a specific cache now? it’s possible within the cloudflare dashboard, but obviously I dont wanna do that manually.

So, is there an API to do that? That would be really great.
Notice: I don’t want to delete the whole cache, only a specific key/value.

Problem solved thanks to the amazing discord community.

https://developers.cloudflare.com/workers/runtime-apis/cache

It’s NOT a key value store as I thought (i wanted to use the Cache API instead of WorkersKV as a key value store because i dont like the WorkersKV pricing)

the key is ALWAYS a GET request !

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