Cache is incomplete, cleared too frequently or randomly

Sometimes, you might notice the cache is being cleared randomly, without a clear explanation. Some symptoms of this could be: 

  • The cache folder is incomplete.
  • There is a random number of cached pages.
  • You experience a sudden slowness of some pages.
  • There are too many rocket_preload_job_preload_url entries in the Action Scheduler actions table.

In normal circumstances, WP Rocket will clear the cache as described in this doc: How often is the cache cleared, and if enabled, the Preload should be triggered too.

If you notice the cache is cleared inconsistently, please keep reading to find potential causes and solutions.

Third party plugins

Many plugins interact with cache plugins like WP Rocket, clearing the cached files under some circumstances to prevent issues with outdated contents. 

This can happen, for example, when you make changes to your website. Plugins can use our function: rocket_clean_domain() to delete the whole cache. 

Known plugins that might be clearing your cache:

  • Divi Overlays
    Calls rocket_clean_post on content updates
  • Divi Bars
    Causes rocket_clean_domain to be called on content updates
  • Maintenance
    It will clear the cache when you put the site in maintenance mode.
  • Really Simple SSL
    It will clear the cache when they detect any changes to the htaccess file.
  • Smash Balloon Instagram Feed
    It will clear the whole cache when they need to update their own cache.
  • User Registration
    It clears the cache every time the registration form is rendered.
  • LayerSlider WP
    Its Clear 3rd party caches option, which will call clear WP Rocket on every slider update.
  • Hide My WP Ghost – Security Plugin

    It will empty WP Rocket's cache after saving their settings.

  • Judge.me Product Reviews for WooCommerce
    This plugin will clear WP Rocket's cache each time a new review is published. They do it by calling rocket_clean_domain()
  • Woostify Pro
    Woostify clears the Elementor cache after adding their scripts in the frontend, which in turn triggers WP Rocket cache clearing.
  • Bertha AI
    This plugin is creating taxonomies, and triggering full cache clearing constantly.
  • Divi LearnDash Kit
    The cache is constantly cleared whenever a non-cached page of the sfwd-courses CPT is accessed. 
  • SiteOrigin Widgets Bundle
    The whole cache is cleared every time a widget is updated on a post / page. 
  • SEO Plugin by Squirrly SEO
    This plugin clears the whole cache is cleared each time a post SEO snippet is edited, created, deleted, etc.


Known issues

We have also discovered that the cache can be unexpectedly cleared in some specific cases:


Troubleshooting

You can install this plugin helper, it will create logs with useful information to determine if your theme or plugin is clearing the cache too frequently. 

📥   Download (.zip):  WP Rocket | Logging Cache Clearing
Developers: You can find the code for this plugin on GitHub.

The files 01-full-cache-clear.txt, 02-partial-cache-clear.txt and 03-rocket_clean_files_log.txt are created in the WordPress installation directory.

If you need help interpreting the information, please open a support ticket and send us the log files. Please, note that after installing the helper, you will need to wait for the cache clear logs to be registered. 

To discover if the cache clearing is triggered by one of your plugins or by your theme, you can install a plugin like String Locator, and search for rocket_clean_domain() to see if that function is being used somewhere.

Possible solutions

It can be hard to "fix" this, but you can take actions to mitigate the effects of unexpected cache clearing:

  • Deactivate plugins: If you have plugins that are clearing the cache and these are not important for your project.
  • Theme: If you discover your theme is clearing the cache, ask the theme developer to see if it is really needed.
  • Enable Preload: Ensure WP Rocket's Preload is enabled.
  • Server-side Cron Job: Set up a server-side cron job to have a more reliable preloading.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.