• Resolved denisgomesfranco

    (@denisgomesfranco)


    I’m aware there is an Exclude tab in the plugin settings which allows us to bypass the cache for certain pages.

    However, I’ll leave here a suggestion to add an option to the page/post editor itself, just like WP Rocket’s: https://img.webnots.com/2021/08/Never-Cache-Specific-Page.png

    This is because I host lots of websites and they all use the same plugin settings, but there is always that odd site that needs a specific page excluded from cache. If I do this via the plugin settings, then it would prevent me from bulk applying updated settings to multiple websites. I would have to remember which sites have specific pages excluded from the cache.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    thanks, will forward to our devs as feature request.

    meanwhile , you can use WP CLI to bulk apply

    Best regards,

    Plugin Support Hai Zheng?

    (@hailite)

    Yes this is in our todo. Thanks for the feedback.

    Thread Starter denisgomesfranco

    (@denisgomesfranco)

    @qtwrk Thanks for the tip! However I’m not too familiar with WP-CLI and my sites are spread over several servers, so I’m not sure if WP-CLI would help.

    I do use MainWP to manage them, though, and it has a “php snippet function” with which, it seems, I can run some code on all sites.

    I am also looking for a way to clear the cache on all sites simultaneously, because when uploading a plugin update (eg. Elementor + Elementor Pro) the site layout sometimes gets messed up.

    Plugin Support qtwrk

    (@qtwrk)

    if you can have code snippet to all sites , then please try below

    add_action( 'init', 'lscwp_disable' );
    function lscwp_disable() {
      if (strpos($_SERVER['REQUEST_URI'], 'edit.php') !== FALSE) {
        define( 'LITESPEED_DISABLE_ALL', true );
    }
    }
    
    function lscwp_purge( $upgrader_object, $options ) {
          if (defined( 'LSCWP_V' ) ) {
            do_action( 'litespeed_purge_all' );
          }
    }
    add_action( 'upgrader_process_complete', 'lscwp_purge', 10, 2 );

    first part will disable plugin on edit.php page , 2nd one should fire on upgrade.

    Plugin Support Hai Zheng?

    (@hailite)

    Done in https://github.com/litespeedtech/lscache_wp/commit/7f0407d9be3395dd05e586c020e5f98001e23e40

    You can use Beta Test to try it before v4.7 release.

    Thread Starter denisgomesfranco

    (@denisgomesfranco)

    Thanks Hai! I’ll wait for 4.7 stable but it’s great to hear that you all are listening to the community. Great work!

    Thread Starter denisgomesfranco

    (@denisgomesfranco)

    Hey @qtwrk , I’m back to inform that running only this code

          if (defined( 'LSCWP_V' ) ) {
            do_action( 'litespeed_purge_all' );
          }
    

    under MainWP’s Code Snippet extension works very nicely. I have tried it with only one site but with this setup I can now remotely clear the cache of all my sites connected via MainWP.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Excluding a page from cache via the page editor’ is closed to new replies.