Beaver Builder Cache Frustrations

Try this then look in the logs again

add_action( 'acf/save_post', function( $post_id ) {
	error_log( 'ACF action triggered' );
	if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
		error_log( 'Function exists, clearing cache' );
		sg_cachepress_purge_cache();
	} else {
		error_log( 'Didnt find the function' );
	}
});

Code needs to be in a plugin … not child theme. Themes load too late for this action.

Add it to a PHP file in wp-content/mu-plugins folder, or create a plugin

Screen Shot 2022-01-28 at 11.55.15 AM

I then created an mu-plugins folder in the wp-contents. Put sgcache.php into it with your most recent php code:

Screen Shot 2022-01-28 at 12.03.47 PM

Was about to send this…then I turned on dynamic caching and it worked. To make sure, I turned dynamic caching off and it wasn’t working.

So…dynamic caching needs to be on.

What a messed up thing. Is this something Siteground needs to be aware of? If so, how should I word it to them?

It does seem to be working now, so thank you for all of your help on this. Will your code work with all ACF pages / posts / global? Is there “1 code to rule them all” that I can put in the mu-plugins folder?

That action should run for all fields and global fields as far as I’m aware. siteground might be interested, only way to find out is contact them :wink: that’s why you pay them after all

It’s unreal.

I do like their server… but instances like this are unfortunate, to say the least.

This helps me out tremendously going forward. As I said, I’ve been using ACF more and more for clients to update their sites. I can now ditch BB Delete Cache…and set them to their proper roles (instead of admin). Thanks so much. Sorry for the frustration.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.