Not Purging All Regions Simultaneously?

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:

  1. 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.)
  2. 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.
  3. 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!

This certainly warrants some investigation.

Does it ever update for them?

Can they look at the response headers on that to check cf-cache-status and age?

Thanks for the reply and help! Sorry for my delayed reply; this post got auto-locked by the system.

  1. No, it doesn’t ever update for them. We had to manually use the “Purge Cache Everywhere” button.
  2. We’ve temporarily fixed the issue with “Purge Cache Everywhere”, but will look for those headers as soon as it happens again and report back. (There’s definitely still an important issue here that we need to fix).
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.