Désactiver toutes les suppressions de cache automatiques
Automatic cache management is one of WP Rocket's most sophisticated features. We've put a lot of thought into which actions performed on a WordPress site should cause the plugin to clear either the entire cache or parts of it.
In 99% of cases, leaving this delicate software component intact is probably the best option. 🙂
However, if you are determined to disable all automatic cache deletions, you should first read this documentation before proceeding: How often is the cache updated?
Help plugin
Once you are sure you want to do this, install and activate this small helper plugin.
Note: This plugin does not disable the Cache Cleanup Timeout setting , so if you want to avoid this as well, you should set it to 0 .
📥 Télécharger (.zip): WP Rocket | Disable Cache Clearing
Developers: you can find the code for this plugin on GitHub .
Warning! When you activate this plugin, WP Rocket will cache your pages but will no longer automatically clear your cache when you make changes! This can lead to outdated or obsolete content on your site, so be careful!
If you encounter problems (forms not working, AJAX errors, etc.), you will likely need to clear the cache periodically. Please read How to clear the cache via a Cron job
Disable the deletion of the homepage when clearing the cache
When you clear the cache for a post, WP Rocket automatically clears the cache for the homepage. This happens regardless of whether the above helper plugin is installed or not.
This default behavior of WP Rocket is intentional because changes to subpages usually mean that the homepage also needs to be updated.
However, if you wish to disable this behavior and prevent the homepage cache from being cleared when other content is cleared, you can add the following code snippet to your site :
add_filter( 'rocket_clean_home_after_clean_post', '__return_false' );