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
If you notice the cache is cleared inconsistently, please keep reading to find potential causes and solutions.
In this Article
3rd 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:
- 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 calling
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
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.
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.
- Automate Preload: You can trigger a cache preload with a script every night, for example. Please read this article that describes how to do it. Only available on WP Rocket versions older than 3.12.