When does WP Rocket delete which files?

Below you'll find the specific triggers which cause the contents of each of WP Rocket's folders to be deleted.

/cache/wp-rocket/www.example.com/

  • When WP Rocket settings are changed: That is, when activating and deactivating features that affect the frontend of the site, and when editing their exclusions. 
  • Clear Cache lifespan
    • Only files older than the specified lifespan will be deleted. 
  • Automatic triggers:
  • Manual triggering of Clear Cache (from the WP Rocket admin toolbar, or WP Rocket Dashboard tab)
  • When the cache is cleared by calling rocket_clean_domain.
  • Can also be triggered by hosting/caching compatibilities to keep the caches in sync (e.g. on WP Engine and others).
  • When Elementor’s CSS Print Method is set to External File, if a post or the Elementor CSS of a post is updated.
  • Updating WP Rocket, depending on the type of changes included in the new version.
  • After the dynamic lists of exclusions are automatically imported each week.
  • When the Used CSS (from the Remove Unused CSS option) has been cleared, manually or automatically.

Related function: rocket_clean_domain.

/cache/min/

  • Manual triggering of Clear Cache (from the WP Rocket admin toolbar, or WP Rocket Dashboard tab).
  • Deactivation of Minify CSS files or Minify JavaScript files, not Combine JavaScript files.
  • Is NOT deleted when Clear Cache lifespan is triggered or via a cron job using ONLY rocket_clean_domain.
  • Is deleted when clearing cache is triggered via a cron job using rocket_clean_domain AND rocket_clean_minify.
  • Beaver builder cache clear.
  • When Elementor's CSS Print Method is set to External File, and the Elementor CSS in a post is updated, the CSS files in this folder are deleted.

Related function: rocket_clean_minify.

/cache/busting/

  • Manual triggering of Clear Cache (from the WP Rocket admin toolbar, or WP Rocket Dashboard tab).
  • ⚠️ Is NOT deleted when Clear Cache lifespan is triggered or  via a cron job using rocket_clean_domain.
  • When Elementor's CSS Print Method is set to External File, and the Elementor CSS in a post is updated, the CSS files in this folder are deleted.

Related function: rocket_clean_cache_busting.

/cache/critical-css/

  •    When the theme is changed.
  •    When Load CSS Asynchronously is enabled.
  •    When a regeneration of Critical Path CSS is triggered.

Related function: clean_critical_css().

/cache/used-css/

  • Manual triggering of Clear Used CSS via the WP Rocket toolbar menu.
  • Switching themes.
  • Changing the items added to Remove Unused CSS's CSS safelist text area.

For specific pages/posts:

  • Editing a post/page.
  • Editing/deleting terms.
  • When the comment count changes.

/cache/background-css/

💡In some cases 3rd party plugins/themes/hosts could also be using our “clean” functions in their code.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.