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 plugin
Callsrocket_clean_post
on content updates - Divi Bars plugin
Causesrocket_clean_domain
to be called on content updates - Maintenance plugin
It will clear the cache when you put the site in maintenance mode.
- Really Simple SSL plugin
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 plugin
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 callingrocket_clean_domain()
- Woostify Pro plugin
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.
Known issues
We have also discovered that the cache can be unexpectedly cleared in some specific cases:
- Excessive terms clearing during the partial purge #2549
- When a slug is shared amongst a page and posts, all the posts might be cleared during partial purge #2698
- Cache recreated on each page load #2156
- Extensive cache clearing when updating non-published products/CPTs #3770
- Cache is cleared too often when importing products
Troubleshooting
📥 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.
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.