Automate Cache Clear


I have a client site built in WordPress that’s on the CloudFlare Business Plan. The site gets updates from a 3rd party site over night. After the import the cache is cleared via Automatic Cache Management. But there’s always a few pages whose cache isn’t cleared.

Is there a way to schedule clearing of cache? Since the site is using the WordPress plugin and WP CLI, is there a way to clear cache on cron run?


Yep. Use ‘curl’ to hit the API:


If you want to keep things simple, you can do this with the Browser Cache Expiration and a Page Rule for Edge Cache TTL value in CloudFlare. So for example ‘every two hours’.
No need for extra software.


I ended up using the purge cache by URL since there were only a handful of pages whose cache wasn’t being cleared through Automatic Cache Management


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