Wordpress Protected Pages + Litespeed Cache possible bug

#1
Hi guys, how are you? :)

I'm trying to password protect a page on a new wordpress install with no other plugins, only LSCache, but the page asking for the password is being cached and served instead of showing the real page after I enter the password.
You can check the test page here: http://webapp142761.ip-95-216-157-207.cloudezapp.io/privacy-policy/
The password is: teste

If I disable LScache, the page loads fine after entering the password.
From what I understood reading https://blog.litespeedtech.com/2018/01/03/wpw-password-protected-posts/, it seems the password protected page should be compatible with LSCache automagically, right?

Can you please test it and confirm to me if this is a bug or normal behaviour?

Thanks!
 
#2
How does the password Protection work, Do you add it as a shortcode? Or does it add a cookie when the password is entered, I seem to be unable to get past the Password Protected Page, because of the Cache.

Litespeed Cache will by default store only one Cache Copy per URL, but it can be customized to store multiple cache's using ESI(Enterprise Only) or using Cookies.
 
#3
I removed the cache so you can test.

I'm using wordpress own password protected function, so I really don't know how it is done. I think it is setting a cookie: "wp-postpass_9abXXXXXXX"
 
#4
I removed the cache so you can test.

I'm using wordpress own password protected function, so I really don't know how it is done. I think it is setting a cookie: "wp-postpass_9abXXXXXXX"
Add the following code to your .htaccess -
RewriteRule .* - [E=Cache-Vary:wp-postpass]

This will create a different cache for the browsers which have the wp-postpass_XXXXX cookie, and should solve your problem :)
 
#6
By the way, since this seems to be a default wordpress cookie value, shouldn't it be added to LiteSpeed Cache .htaccess rules without the user needing to edit it? It would be more user-friendly for sure
 
#7
By the way, since this seems to be a default wordpress cookie value, shouldn't it be added to LiteSpeed Cache .htaccess rules without the user needing to edit it? It would be more user-friendly for sure
It might make things slow for sure, Litespeed Cache will then have one more thing to check. It's best to do it manually if you plan to use that functionality :)
 
Top