Purge Publish Cache via API

Right now the publish documentation says this:

"However, this does mean that when you change site settings, publish new content, or unpublish content, visitors might not see the latest version for a short while. Currently, our cache is configured to persist for an hour before it has to be “re-validated” to ensure the content hasn’t changed.

If you’ve just published items but you are still seeing an older version, you can typically perform a “hard refresh” by holding the reload button and choosing “Hard reload” in the dropdown menu. Failing that, you can try clearing the browser cache or disabling cache using the developer tools in the network tab."

I think it should be possible to improve this behavior so that the cache is cleared via the Cloudflare API every time someone updates their site. I was able to set up GitHub pages to do this. I forget exactly what I did, but I saved the bookmarks to the pages I referenced at the time:

1 Like