How to purge cache for "worker"'s static HTML page?
I've following the CD Vite plugin guide is create a starter project, then added a "index.html" at project's root, and deploy by running "npx wrangler deploy", (Also, I'm using a free account). So now if I go to my worker domain, I see the html home page, if I go to any path that is not home page, I get the "Running in Cloudflare-Workers!" plain text response. So it's working. But the problem is, after I deployed a new version of the home page "index.html", I can't see the changes live. I believe it is because the page been cached, judging on the
Cf-Cache-Status: HIT in the page's response headers.
So then I was looking for ways to clear cache. Then I found this Purge everything doc, but I cannot find the "Caching" section/page in the CF dashboard. I don't know if this is because I'm using a free worker.dev subdomain, and you can only purge for your custom domain.
Then I found there's API for cache purging from here, post /zones/{zone_id}/purge_cache, but it needs a zone_id, so I tried get /zones to see what zones I have in my account, and I got none. So I don't know how to proceed with this method as well.
I was wondering if anyone could help me understand how to purge cache while using CF worker, specifically with its Vite plugin. Or is there any way to purge cache without doing so manually through the CF dashboard, or through CF API? Any pointers would be very appreciated! Thank you very much!0 Replies