Back to Community

How to Schedule and Control WP-Optimize's Cache Preload for Better Performance

12 threads Sep 10, 2025

Content

Many WordPress users leverage the powerful caching and preloading features of the 'WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance' plugin. A common point of confusion and troubleshooting revolves around how to effectively schedule the cache preload process and manage its impact on server resources. This guide explains how preload scheduling works and provides solutions to common configuration issues.

Understanding Cache Preload Scheduling

The preload feature works by simulating visits to your site's pages, which generates the cache files in advance so that real visitors experience faster load times. You can run this process manually or configure it to run on a schedule.

When you configure a scheduled preload, the plugin uses your site's built-in WordPress cron system to trigger the task. The time you set for the schedule is the exact time the task will attempt to run each day, week, or other interval. For example, if you set a daily preload to run at 12:01 AM, it will repeat at that specific time every day.

Common Challenges and Solutions

1. Preload Does Not Run on Schedule

This is a frequent issue, often linked to how the WordPress cron system functions. WordPress cron relies on site visits to trigger scheduled tasks. On low-traffic sites, there may be no visitors at the exact scheduled time to initiate the preload, causing it to be missed.

Solution: To ensure preload runs reliably, you can set up a server-level cron job to visit your site's wp-cron.php file at regular intervals. A common practice is to set this cron job to run every 5 to 15 minutes. The URL your cron job should call is: http://yourdomain.com/wp-cron.php?doing_wp_cron. This external trigger simulates a site visit and helps ensure scheduled tasks like preload run on time.

2. Preload Consumes High CPU Resources

Preloading a large site, especially an e-commerce store with thousands of pages, can be resource-intensive. The process of generating many pages in quick succession can temporarily increase server load and CPU usage, potentially slowing down the site for other visitors.

Solutions:

  • Schedule for Off-Peak Hours: Configure the preload to run during your site's lowest traffic period, typically overnight.
  • Adjust Preload Intervals (Advanced): The preload process runs in chunks. You can use a filter to increase the delay between processing these chunks, which spreads the load over a longer period. The filter to modify this interval is wpo_page_cache_preload_continue_interval.

3. Manually Triggering Preload After a Cache Purge

By default, manually purging the cache does not automatically trigger a preload. However, you can programmatically link these two actions.

Solution: You can use the wpo_cache_flush hook in your theme's functions.php file or a custom plugin to run the preload function immediately after any cache purge event, including a manual one. The code snippet would look similar to this:

add_action('wpo_cache_flush', 'my_custom_preload_after_purge');
function my_custom_preload_after_purge() {
    if (class_exists('WP_Optimize_Page_Cache_Preloader')) {
        WP_Optimize_Page_Cache_Preloader::instance()->run('manual');
    }
}

Important Note: Always test code snippets on a staging site before implementing them on your live website. Incorrect code can cause site errors.

Key Takeaways

  • The scheduled preload time you set is the exact time the task will attempt to run.
  • Low-traffic sites may require an external cron job to trigger wp-cron.php for schedules to work reliably.
  • For large sites, schedule preload for off-peak hours to minimize performance impact.
  • Automatic preloading after a manual cache purge requires custom code using the wpo_cache_flush hook.

By understanding these scheduling mechanics and implementation details, you can better configure WP-Optimize's preload feature to maintain a fast, cached site without unnecessary performance bottlenecks.