Skip to content

How to prevent Rapid Cache from clearing the cache upon plugin activation or deactivation

gdarko edited this page Sep 6, 2020 · 2 revisions

Rapid Cache will automatically clear the cache on your site whenever you activate or deactivate a WordPress plugin. Many WordPress plugins add or change content on your site, so Rapid Cache clears the cache to ensure that an old cache file is not served to a visitor.

If you are activating and deactivating plugins on a regular basis and want manual control over when the cache is cleared, you can disable this automatic behavior by creating a small MU-Plugin.

Create this file and directory: wp-content/mu-plugins/rc-disable-clear-on-plugin-activate-deactivate.php:

<?php
/*
Plugin Name: Disable Rapid Cache Automatic Clear Cache on Plugin Activation/Deactivation
Description: Disables the Rapid Cache Automatic Clear Cache on Plugin Activation/Deactivation
Author: MegaOptim
Version: 1.0
Author URI: https://megaoptim.com
*/

add_filter('rapid_cache_auto_clear_on_plugin_activation_deactivation', '__return_false', 10, 0);

Clone this wiki locally