how to prevent post update time and DL count from caching Litespeed


in my site, I have some sections like post update time and DL count.
these sections must return real value.
for them, I used from ESI block by PHP code.

add below code in my function.php file:

add_action('litespeed_esi_load-esi_last_update', 'esi_last_update_esi_load');
function esi_last_update_esi_load($params)
echo dw_time_ago('j F Y');

and replace below code instead of post update time:

echo apply_filters( 'litespeed_esi_url', 'esi_last_update', 'esi last update' );

but in my index page, there are many the posts that they have update post time and the posts loaded with slow speed and one by one

, hossein naghneh 1 year 2020-07-13T05:10:35-05:00 0 Answers 56 views 0

Leave an answer