ESI block not showing up
-
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]
- The topic ‘ESI block not showing up’ is closed to new replies.