Disable caching via PHP for a specific page

[ad_1]

Plugin Support
qtwrk

(@qtwrk)

you can use

do_action( 'litespeed_control_set_nocache', 'nocache for xxx reason' );

for example

add_action( 'template_redirect', 'lscwp_product_no_cache' );

function lscwp_product_no_cache() {
if ( is_product() ) {
do_action( 'litespeed_control_set_nocache', 'no cache for product page ' );
}
}

this will disable cache on product page

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer