• Resolved luminsol

    (@luminsol)


    Hi,

    In the change log for v3, there is a mention that the code needs to be adjusted if using LiteSpeed_Cache_API.

    Is there any documentation regarding what exactly has been changed? I can’t seem to find it, so if someone could point me in the right direction I would be most grateful.

    API API refactored. * NOTE: All 3rd party plugins that are using previous APIs, especially LiteSpeed_Cache_API, need to be adjusted to the latest one. Same for ESI blocks.* ESI shortcode doesn’t change.

Viewing 4 replies - 16 through 19 (of 19 total)
  • Plugin Support Hai Zheng?

    (@hailite)

    Can you turn on debug log and check if it gave any purge header or not?

    Hi Hai,

    I’ve tried the debug log now and I can see something is happening in the purge log when the script is run and a product is changed. I can’t work out what is actually happening from the log though. Is it possible for me to send you this privately to take look to see if it’s working as it should?

    Gordon

    • This reply was modified 4 years, 6 months ago by gferguson78. Reason: Misunderstood the original response

    Hi!

    I just tried this example :

    <?php
    echo apply_filters( ‘litespeed_esi_url’, ‘my_esi_block’, ‘Custom ESI block’ );
    ?>

    add_action( ‘litespeed_esi_load-my_esi_block’, ‘my_esi_block_esi_load’ );

    function my_esi_block_esi_load()
    {
    do_action( ‘litespeed_control_set_ttl’, 300 );
    #do_action( ‘litespeed_control_set_nocache’ );
    echo “Hello world”.rand (1,99999);
    }

    And it’s works. EXCEPT that it doesn’t cache anything…

    I’m new to litespeed… so I might miss something obvious but… what?!?

    Also is there any documentation and/or exemples about the optionals parameters :

    $control = ‘private,no-vary’, $silence = false, $preserved = false, $svar = false, $inline_val = false

    Last question : How do I know if the API and ESi are active (to use a condition)?

    I tried this :

    $esi_status = apply_filters( ‘litespeed_esi_status’ );

    But it breaks my site…

    Thanks!

    ps : I activated ESI in wp_admin…

    OKAY… I just undestdood that it does cache!! But not as I’m logged as admin…

    I put $control = ‘public’… hope it’s OK… I’m using it to load posts on a single page via ajax… and I want to cache the posts content for everybody… (but I don’t care for the admin…) and it’s seems to work…

    But I still need to test if the ESI and the API are active to load from the database if they are not…

    So if anybody knows how… I’ll be glad to hear it !

    Cause : $esi_status = apply_filters( ‘litespeed_esi_status’ ); still break my site…

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘What has changed with LiteSpeed_Cache_API ?’ is closed to new replies.