Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erisa/cf-cache-clear-worker-webook
Cloudflare Worker that clears all cache in a given zone when called. Designed to be used as a webhook.
https://github.com/erisa/cf-cache-clear-worker-webook
cloudflare cloudflare-workers
Last synced: 3 months ago
JSON representation
Cloudflare Worker that clears all cache in a given zone when called. Designed to be used as a webhook.
- Host: GitHub
- URL: https://github.com/erisa/cf-cache-clear-worker-webook
- Owner: Erisa
- License: unlicense
- Created: 2021-08-28T20:52:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-15T12:54:34.000Z (over 1 year ago)
- Last Synced: 2024-04-15T07:51:37.510Z (10 months ago)
- Topics: cloudflare, cloudflare-workers
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clear cache worker webhook
Cloudflare Worker that clears all cache in a given zone when called. Designed to be used as a webhook.
## Setup
Cloudflare Workers:
[Create API token with this link](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22cache%22%2C%22type%22%3A%22purge%22%7D%5D&name=Cache+purge)
and then
```
wrangler secret put SECRET
wrangler secret put CF_ZONE
wrangler secret put CF_API_KEY
wrangler publish
```Or local:
```
npm i -g miniflare
miniflare -b SECRET=secrethere -b CF_API_KEY=apikeyhere -b CF_ZONE=zoneidhere
```## Usage
![](https://cdn.erisa.moe/firefox_Udg8kjUU6l.png)