cloudflare / templates

A collection of starter templates and examples for Cloudflare Workers and Pages
https://cloudflareworkers.com
MIT License
1k stars 638 forks source link

[Question] How to purge cache once new version of site is released? #59

Closed Tkach7 closed 4 years ago

Tkach7 commented 4 years ago

First of all, thanks guys for amazing work! Edge caching process works very well as a result performance of pages was improved! So, Edge caching was set up by this example https://github.com/cloudflare/worker-examples/tree/master/examples/edge-cache-html.

Problem

The problem is that once a new version for the site is released, cache should be purged.

Question

The question is how to purge cache which is stored in KV via API. It is clear how to reset it via api by zone, but there are no ideas how to do it for KV space.

Upd So, i found the solution, to be able to purge cache via api, we can use api for purging cache by tags