Workers Cache vs Pages Cache

I'm seeing intermittent issues where font awesome icons are rendered strangely. I dealt with this when our app was on pages and resolved it by purging the cache via our github action
- name: Purge Cache
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_PROJECT_NAME }}/purge_cache" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-d '{ "purge_everything": true }'
- name: Purge Cache
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_PROJECT_NAME }}/purge_cache" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-d '{ "purge_everything": true }'
It doesn't seem like this same strategy will work for workers. What is the recommended approach?
No description
3 Replies
dapperdandev
dapperdandevOP5mo ago
Ideally, we would be using the standard caching until a new release goes out. Gotcha. So how do I manage the worker's caching mechanism, then? I've seen mixed information about using the worker.js file or the wrangler.jsonc file.
dapperdandev
dapperdandevOP5mo ago
Mmm... Not sure my boss will let me disable caching using the good ol' magic argument. Looks like I need to dive into this: https://developers.cloudflare.com/workers/runtime-apis/cache/
Cloudflare Docs
Cache
Control reading and writing from the Cloudflare global network cache.
dapperdandev
dapperdandevOP5mo ago
I'm sorry. I'm dense. The documentation says it's for workers cache. You're saying it's not?

Did you find this page helpful?