• Resolved uili

    (@uili)


    I’m developing a widget on which will show the user’s address based on the postcode he enters. But with the cache active, the address always ends up being the first postcode entered, if you change the postcode, the address changes as a result, but when you change the page it still shows the previous address.

    The solution would probably be using the ESI Block Url, I followed the example https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url but even with the example for me it doesn’t load anything, the block it is empty.

    In the source code it even shows the block, with src, if I access the src I can see the content that it should show there, but on the page it doesn’t.

    <!-- lscwp Localiza??o de entrega -->
    <esi:include src="/?lsesi=location_block&_control=private%2Cno-vary&_hash=6595e7906d7648c08f3a3f57aca29408" cache-control="private,no-vary">
    <!-- lscwp Localiza??o de entrega esi end -->
    </esi:include>

    The code used to show the block is this:
    echo apply_filters( 'litespeed_esi_url', 'location_block', 'Localiza??o de entrega' );

    The code in function.php is this:

    add_action( 'litespeed_esi_load-location_block', 'location_block_esi_load' );
    function location_block_esi_load(){
        #do_action( 'litespeed_control_set_ttl', 3 );
        do_action( 'litespeed_control_set_nocache' );
        echo '<span style="line-height:1" class="end_wrap">Será que entrega?</span>';
    }

    The page I need help with: [log in to see the link]

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

    (@qtwrk)

    Hi,

    are you using OpenLiteSpeed ?

    Thread Starter uili

    (@uili)

    Well, I found out that it only works with LiteSpeed Server Enterprise right after I opened this topic. So I even managed to get it working after moving the installation to a LiteSpeed Server but the site ended up being very slow with the same settings used in OpenLiteSpeed, perhaps due to lack of knowledge and familiarity with CyberPanel. So I ended up changing my plugin to work with Cookies instead of ESI and stick with OpenLiteSpeed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ESI block not showing up’ is closed to new replies.