LS Cache + Password Protected




Wordpress LScache Plugin: LS Cache + Password Protected

Last Updated on: Wed, 15 Apr 2026 00:00:02
Issue: if example.com homepage/any page has been previously viewed && cached Password Protected doesnt fire to verify the security cookie exists and the 302 to password protected password entry is bypassed completely. Is there any way to have the initial request sent to the sever or have LS Cache check for the existence of the cookie. Hi, please try add this at top of your .htaccess RewriteRule . - [E=Cache-Vary:cookie_name] change the cookie_name to the cookie you want to have it checked and then purge all , and restart webserver if you are using OpenLiteSpeed Best regards, Unfortunately doesnt seem to make a difference. Password protected has a default cookie name bid_1_password_protected_auth . RewriteRule . - [E=Cache-Vary:bid_1_password_protected_auth] At the top of .htaccess yielded no results. edit: wouldnt there need to be a rule to bypass the cache with this, from what Im reading its only to detect a cookie it wouldnt do anything other than that? Hi, this rule will vary the cache , by that saying generate one cache for user who has this cookie , and another cache for user who doesnt have this cookie if you remove what you added in previous, then you go to Cache -> Exclude -> Do not cache cookie , add your cookie name there, save and purge all , how does that go ? I have it set up to exclude the cookie already as well as the string in the uri identifying the password protected form to enter the password. Those both seem to work. Unfortunately the absence of the bid_1_password_protected_auth cookie doesnt seem to load the password entry page with RewriteRule . - [E=Cache-Vary:bid_1_password_protected_auth] in the header of .htaccess. Is there perhaps a place to add the rewrite rule somewhere in Openlitespeed directly? I havent been able to find anything in relation to doing that. thx for your continued help. Hi, Did you restart OLS after you edited .htaccess ? it wont take effect in OLS until you restart it I have it set up to exclude the cookie already whats the cookie name you excluded ? same as the one in the rule ?



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference