When a Cloudflare domain is configured for your Mindspun site, you may manually clear the Cloudflare cache for that domain from the site dashboard.

Cloudflare Clear Cache

This block is displayed after you setup Cloudflare.

Clicking 'Clear Cache' removes all pages for that domain from the Cloudflare cache causing them to be reloaded from your site.

Note: this only affects your site when you are using 'Manual' caching.  The 'Default' caching mechanism is to always load the page from your site.

Automatically clearing the cache on page changes

Your Ghost instance can be configured to clear the Cloudflare cache automatically on page changes.

Create a Mindspun integration in Ghost

From your Ghost admin dashboard, click the "Integrations" link and then click "Add Custom Integration".

Ghost Add custom integration

Name your integration "Mindspun" and click "Create".  Optionally fill in the description and add an image.

If you already have a Mindspun integration for another purpose - such as using steady - then you can just use that integration for this purpose too.

Create Ghost webhooks

Create a Ghost webhook for each update you want to trigger a cache clear.

Ghost Add webhook

Create a webhook that triggers on the 'Site changed (rebuild)' event.  This event triggers any time your make a change to your site such as update a post, upload a new theme, etc.

The 'Target URL' is:

https://api.mindspun.com/apps/ghost/example/webhooks/cloudflare_purge_cache

where 'example' in the above URL is replaced by the name of your Mindspun site (the name you chose during site creation).

Once you click 'Save' you're all done!  Your Cloudflare site will now automatically update any time your make a change to your Ghost instance!

Note: Cloudflare warns that it may take up to 30 seconds for the cache to clear.

You can also use individual events to clear your cache, you just have to make sure you manually clear your cache any time your site changes that doesn't trigger an associated event.