How to Automate Cache Purging and Preloading with Super Page Cache

Automating cache purging and preloading ensures your website always delivers updated and cached content without manual intervention. The Super Page Cache plugin provides a straightforward way to achieve this using cron jobs. Follow the steps below to configure automation for your site.


Automating Cache Preloading/Purging with a Cron Job

To automate the preloading/purging process at intervals of your choice, we recommend setting up a URL-based cron event instead of a simple cron job. Follow the steps below to configure it properly.

1. Configure the URL-Based Cron Event

1. Install and activate the WP Crontrol plugin to manage cron events easily.
2. Now navigate to Tools > Cron Events in the WordPress dashboard. 
3. Add a new URL cron event
4. Under the URL field, add your cache purge or preload URL provided by the plugin in your dashboard. It will look like this https://yourwebsite.com?swcfpc-purge-all=1&swcfpc-sec-key=CronJobSecretKey
5. Save the Cron event. That's it. 

2. Manually Trigger WP-Cron

Since WP-Cron depends on site traffic, you may need to trigger it manually:
1. Open your website in an incognito window to simulate user traffic.
2. This should activate WP-Cron and execute the cache purge event.

3. Verify the Cache Purge Status

After running the cron event manually, follow these steps to confirm the cache has been purged:
1. Open your website in an incognito window.
2. Use the Developer Tools in your browser to check the cache status.
3. If the status appears as MISS, EXPIRED, or REVALIDATED, it confirms that the cache has been successfully purged.
If you encounter any issues or need further assistance, feel free to reach out.

Automating Cache Purging via cPanel

Automating cache purging ensures outdated content is promptly removed. If you are using cPanel, you can create a true cron job to achieve this.

📝 Note: HostGator provides a detailed guide on how to create a true cron job. You can view their guide here: How to Create a True Cron for WordPress. The steps may vary slightly depending on your hosting provider.

If you are not comfortable setting up a cron job, contact your web host for assistance. A recommended interval is once every 10 minutes.

Alternative Method: Online Cron Job Services

1

Go to console.cron-job.org/signup and create an account.

2

Log in and open the Cronjobs panel. Click on Create Cronjob.

3

Fill out the details:

4

Set the execution schedule according to your needs (e.g., every 10 minutes).

Automating cache purging and preloading ensures your website remains fast and updated with minimal manual effort.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us