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 6 years 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…