Single file cache purge is giving mixed results

Doing a single file cache purge on a file is working sometimes, and not working other times. Sometimes it even reverts to an old cached file. We are using the API to automatically call the single file cache purge endpoint to clear cache when a file is updated in our application. I want to also make it clear that I have also tested the following by using the dashboard to do a purge on this file. So I’m confident it isn’t an issue with our API implementation.

Here is the file I am testing

The way I am testing this is by incrememting a number at the beginning of the file (which will trigger the API purge call after I save it). Then I go to a new incognito window in both chrome and firefox to see if the file has been updated successfully. Sometimes, the cdn cache does get purged successfully. Other times, it won’t work. Even after waiting a few minutes it still hasn’t updated. Even more bizarre, I have seen it go back to an old cached file that was cached a few saves ago. For example: I’ll increment the number at the beginning of the file from 1, then 2, then 3. Those will all purge on each iteration successfully, but then I increment it to 4 and when I open the file up in a fresh browser, the file will revert back to 1. I’m not really too sure what to make of this.

For starters, on which Cloudflare plan are you? Free or paid and if paid, which level?

Your nameservers are most likely incorrect for starters and you’ll probably have to fix that first.