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  

In normal circumstances, WP Rocket will clear the cache as described in this doc: How often is the cache cleared?

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:


Known Issues

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


Troubleshooting

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 and/or sitemap preloading 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 
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.