wp-rocket-helpers icon indicating copy to clipboard operation
wp-rocket-helpers copied to clipboard

WP Rocket clears whole cache when ACF option page is updated despite the plugin "WP Rocket | Disable Cache Clearing" is active

Open przestrzal opened this issue 2 years ago • 3 comments

Hi,

everything is described in the title.

Is this bug or oversight?

I use "WP Rocket | Disable Cache Clearing" and i thought that nothing can't clear cache except manual trigger by button or custom function.

przestrzal avatar Dec 08 '22 07:12 przestrzal

Ok,

i've fount it in

/inc/3rd-party/plugins/advanced-custom-fields.php

function rocket_clear_cache_on_acf_options_save( $post_id ) {
	if ( 'options' === $post_id ) {
		rocket_clean_domain();
	}
}
add_action( 'acf/save_post', 'rocket_clear_cache_on_acf_options_save' );

Could you adjust in to obey the "WP Rocket | Disable Cache Clearing" ?

przestrzal avatar Dec 08 '22 09:12 przestrzal

Hello @przestrzal and thanks for creating the issue. I moved it to the correct repository.

Could you share with us exact steps to reproduce when the cache is cleared? Do you need premium version of the ACF plugin?

piotrbak avatar Dec 21 '22 13:12 piotrbak

Hello, i found this solution is not perfect but is working fine !

add_action( 'acf/save_post', function () { define( 'WP_IMPORTING', true ); }, PHP_INT_MIN );

Mil1 avatar Feb 13 '24 15:02 Mil1