• Hi,

    Yoast includes a mecanism that flushes WP Super Cache and W3 Total Cache in _wpseo_activate().

    It calls on line 207 of wp_seo_main.php :
    WPSEO_Utils::clear_cache();

    Which does :

    public static function clear_cache() {
    		if ( function_exists( 'w3tc_pgcache_flush' ) ) {
    			w3tc_pgcache_flush();
    		}
    		elseif ( function_exists( 'wp_cache_clear_cache' ) ) {
    			wp_cache_clear_cache();
    		}
    	}

    First question : why only those 2 and not WP Rocket and other popular cache plugins ?

    Second issue I’ve been having for years : at each update (which are sometimes several in a week), it flushes all the cache, which results in poor performance for websites with thousands of urls.

    I’ve been downloading, removing content of clear_cache() then uploading but I must not be the only one in that case.

    There is no purpose to flush all website cache just for an update.

    Could you provide a hook to deactivate cache flush ? That would be sooooo useful.

    Thanks and long life to Yoast.

    • This topic was modified 3 years, 8 months ago by Eroan Boyer.
    • This topic was modified 3 years, 8 months ago by Eroan Boyer.
    • This topic was modified 3 years, 8 months ago by Eroan Boyer.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Sa?a

    (@stodorovic)

    It’s old code and I agree that should be improved.

    However, functions _wpseo_activate and _wpseo_deactivate are called only at the installation (or manual deactivation/activation of the plugin). WP update doesn’t run these functions (I didn’t notice similar behavior with WPSC). So, I think that it isn’t root of cause of your issue.

    Updating some (Yoast) options could run clear_cache too… You should try to catch when purging was triggered. WPSC offers good debug log. Depends on cache plugin (W3TC or WPSC), you should try to find out debug back-trace when this function called.

    You can create feature request on Github.

    Thread Starter Eroan Boyer

    (@eroan)

    Hi,

    thanks for your answer.

    I don’t update any option, the only thing I do is update and it calls Yoast clear_cache() function since when I manually empty it there is no cache flushing.

    I’ll try debug mode next time, thanks.

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    There is an open feature request to provide the option to deactivate clearing of WordPress cache on plugin activation/deactivation, but as mentioned, this shouldn’t occur when just updating the Yoast SEO plugin.

    Please do try the debug mode as suggested. If you continue to encounter any issues or concerns, we recommend logging it on GitHub – https://yoast.com/help/how-to-write-a-good-bug-report/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cache flushing on update’ is closed to new replies.