Wordpress LScache Plugin: Exclude cookie with wildcard or regular expression
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, when setting a cookie name in the Excludes tab, can I use a wildcard or regular expression to allow detection of cookies with partly dynamic names? Or a group of cookies with a common prefix? I found no info about this on https://docs.litespeedtech.com/lscache/lscwp/cache/#do-not-cache-cookies Hi, sadly no , but you can still manually add a rewrite rule in your .htaccess to override it e.g. RewriteCond % HTTP_COOKIE . test. [NC] RewriteRule . - [E=Cache-Control:no-cache] add this after LSCWP rule block , before WP rule block where . test. partial match to any string that contains test , like 123test or test123 Best regards, OK, thanks And any rule to prevent serving cached pages when that same cookie is present? Hi, Im sorry ? I am not sure what do you mean when this cookie is present , your whole site to this visitor will be literally , uncached at all Best regards, Im afraid that is not the case. At least not for sites hosted at o2switch? Ive had a ticket open about that for quite a while here: [redacted] The recent reply suggest something about LiteSpeed ADC instead of a regular LiteSpeed webserver. Not sure how to relay that to the web host though? And I suspect they wont be able to solve it for me either :/ Reason: removed ticket link Do NOT post ticket link in public please remove that link immediately , you only need to provide the ticket number , then I can check it already , no need for full link yes, if you are using ADC, then you need to add this rule into ADC rewrite rule tab , you will need help from your provider for this an quick draw hope you can understand how this thing works and why htaccess rule doesnt work Thanks for explaining and sorry for the link :/ Hi, no problem , thats how your provider set up their server, and in such case, you will need to ask them to put these rules into ADC vhost rewrite rule in order to make it work properly Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference