We’re encountering an issue where caches don’t seem to be purging correctly.
Process:
After deploying our website, we automatically call the NodeJS API to purge all Cloudflare caches:
cf.zones
.purgeCache(process.env.CLOUDFLARE_ZONE_ID, {
purge_everything: true,
})
This does do something and works fine for us for the vast majority of our users. However, we occasionally have an event where some small population of our users (ex. ~5%) are still served outdated versions of our /index.html
. We’ve found that we can resolve this issue by manually going into the Cloudflare Portal and pressing the “Purge Everything” button.
My questions:
- Is it possible that people in a certain region have an outdated cache that doesn’t get cleared by our JS API call? (I’m trying to figure out if these people are in the same geographic area and will report back.)
- Are we making the correct JS API call here? My understanding is that this call should be identical to the “Purge Everything” button, but we have observed this to not be the case.
- Is there a way that I can debug the state of caches in different Cloudflare regions directly through a Cloudflare API?
Thank you for the help!