Wordpress LScache Plugin: Custom cache ttl rules
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, In the field Force public cache URLs , 1. If a page match more than one rule, is it the latest one that will apply ? Example: /custom_category 3600 /custom_category. 20[0-1][0-9] 604800 The page /custom_category/news-5-february-2017 will match both rules, is it correct that the latest one (ttl 604800) will apply ? 2. Can we use Apache variable % TIME_YEAR ? Example: /custom_category 604800 /custom_category. % TIME_YEAR 3600 So that /custom_category/news-2019 will have a ttl of 604800 and /custom_category/news-2021 will have a ttl of 3600 ? 3. Im using LSCache and Quic.cloud CDN and trying to programmatically refresh the cache of some posts when some external data is fetched: ? when using wp_update_post($post_data) the post data is updated in the database, but the cache and cdn dont refresh ? when using do_action( litespeed_purge_post, $post_id ) the same happens, cache and cdn are not refreshed ? when editing a post manually in the admin panel, after i click save , the cache and cdn are immediately refreshed. Is there a way to get the same result programmatically ? Thank you very much! Hi, 1) it will apply the first matched 2) sadly no , TIME_YEAR is a variable used on RewriteCond , this env var doesnt set into PHP env , and even so , LSCWP wont read it 3) may I know how exactly was that wp_update_post and do_action was performed ? if you do it by WP CLI , it wont work , the purge header needs to have a domain in URL e.g when user uses WP CLI or PHP CLI to run cron job , the purge event wont happen , because server does not know which domain is that php xxx/wp-cron.php -> this way when you edit some post/pages , it wont purge cache curl/wget xxxx/wp-cron.php -> this way , it will do the purge , as server knows the domain from URL Best regards, Thank you very much for your answers. Indeed, i was using php xx/wp-cron.php I tried wget with the full domain name but it didnt change anything unfortunately. But i switched to using do_action( litespeed_control_set_ttl, xxx ) in my theme header.php and it seems perfect for the pages that need custom ttl during specific days. Hi, then please enable debug log , to see what happens and if it has received purge call and sends out purge header yes, setting set by API will override the plugin menus setting , in this case Best regards, Hi, Im going to mark this topic Resolved , due to lack of activity. If you still need help, please feel free to re-open it. When re-open it, please also change the topic status to not solved Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference