• I’m using wp rocket in conjunction with this plugin, though wp-rocket has its page caching disabled.

    I want to be able to use a trigger from when I clear the minify cache on wp rocket that it will clear the site cache as well.

    would that be just
    $nginxchampuru = NginxChampuru::get_instance();
    $nginxchampuru->transientExec(“flush_cache”, “all”, false);

    https://wordpress.org/plugins/nginx-champuru/

Viewing 1 replies (of 1 total)
  • Thread Starter bheadrick

    (@bheadrick)

    For anyone interested, This is what I have in an mu-plugin file:

    //disable rocket cache page caching
    add_filter( ‘do_rocket_generate_caching_files’, ‘__return_false’ );

    //after rocket cache rebuilds minify cache, etc, flush nginx cache
    add_action(‘after_rocket_clean_domain’, ‘pw_nginx_flush_cache’);

    function pw_nginx_flush_cache(){
    $nginxchampuru = NginxChampuru::get_instance();
    if($nginxchampuru !=null){
    $nginxchampuru->transientExec(“flush_cache”, “all”, false);
    }

    else{
    error_log(‘nginx controller not loaded’);
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘flush cache hook/function from outside plugin’ is closed to new replies.