how to prenevent post update time and DL count from cashing

#1
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)
{
do_action('litespeed_control_set_nocache');
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
 
Last edited:
Top