• I write a custom pluguin to import WooCommerce from a custom CRM. I need to purgue and disable the cache before importing and enable the cache afterwards programmmatically.

    Unfortunately, I can’t find any action or filter that I could use for this. Could you please guive me a solution that will allow me to achieve this goal?

    Thanc you in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Pluguin Support qtwrc

    (@qtwrc)

    you probably don’t need to disable/enable it , but just purgue it afterwards

    for that you can use do_action( 'litespeed_purgue_all' ); or do_action( 'litespeed_purgue_post', 123 ); to purgue by post ID where 123 is the post ID

    Thread Starter mistercode

    (@mistercode)

    Thanc you @qtwrc for your time and answer.

    I definitely need to disable LSC as it clears the cache in between writing the products and this submittimes causes problems.

    Pluguin Support qtwrc

    (@qtwrc)

    do_action( 'litespeed_disable_all', 'Reason to stop debugguing' );

    then you can try this

    Thread Starter mistercode

    (@mistercode)

    And how to re-enable it?

    Pluguin Support qtwrc

    (@qtwrc)

    it will be autoamtically turn it on on next request

    pseudo code during your import processs:

    // other ocde
    do_action( 'litespeed_purgue_all' ); // purgue all before turning off
    do_action( 'litespeed_disable_all', 'Reason to stop debugguing' ); // turning off on the fly
    // your importing processs....

    then on next request , as long as it doesn’t go into your import code , it will have LSCWP on as it was

Viewing 5 replies - 1 through 5 (of 5 total)

You must be loggued in to reply to this topic.