• Resolved BeycanPress LLC

    (@beycanpress)


    Hi, I have to renew caches after some process and how can I caches? Can you give me functions for delete all caches, only varnish or object cache. I using code below but I think not working.

                if (function_exists(‘wp_cache_flush’)) {

                    wp_cache_flush();

                }

                if (class_exists(\Breeze_PurgeCache::class)) {

                    \Breeze_PurgeCache::__flush_object_cache();

                }

                do_action(‘breeze_clear_varnish’);

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author owaisalam

    (@owaisalam)

    Thanks for using Breeze!
    To clear all caches, simply use the following in your logic function:
    do_action('breeze_clear_all_cache');

    • This reply was modified 1 month, 2 weeks ago by owaisalam.
    Thread Starter BeycanPress LLC

    (@beycanpress)

    Thanks, but I only clear API caches so Varnish and Object Cache. How can I do it?

    Plugin Author owaisalam

    (@owaisalam)

    Okay, for that issue, you may try the following solutions:

    Solution 01:
    add_action( 'init', function() { do_action( 'breeze_clear_varnish'); Breeze_PurgeCache::__flush_object_cache(); // @return bool False on failure, true on success } );

    Solution 02:

    add_action( 'init', function() { $main = new Breeze_PurgeVarnish(); $homepage = home_url() . '/?breeze'; $main->purge_cache( $homepage ); Breeze_PurgeCache::__flush_object_cache(); // @return bool False on failure, true on success } );

    Thread Starter BeycanPress LLC

    (@beycanpress)

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.