I’m using Hostinger hosting, which runs on a LiteSpeed server, so I use the LiteSpeed Cache plugin. I have a membership website using the Paid Memberships Pro plugin, and some of my content is protected for members only. I’ve enabled caching for guest users and disabled it for logged-in users.
The issue arises when a user visits my website as a guest and gets the cached version. When they decide to buy a course and log in, they should be served the uncached version of the webpage. However, they still get the cached page that says the content is protected. I have to instruct them to clear their browser cache and log in again.
Is there any way to fix this? I don’t have any user-specific dynamic content. Is it possible to serve different caches: one for guest users and another for logged-in users? The LiteSpeed Cache plugin is too complicated for me, so I’ve deactivated it for now. Are there any other plugins that can achieve this and are easy to use?
[ad_2]
Does Lightspeed have a granular user exception feature? You could make the exception for your members to be cached while logged in. I use Breeze in Cloudways and they have that option. It’s nice. Then I exclude all urls that shouldn’t be cached.
Likely some misconfiguration at work because this shouldn’t happen. Do you have any other type of caching, for example Cloudflare?
There are no alternatives for LiteSpeed web server. LiteSpeed Cache is the only plugin which works properly with LiteSpeed server, which is why I’m not a big fan of the setup.
I personally recommend users to disable every setting in LiteSpeed Cache except the page and browser cache. Disable the page optimization, image optimization, [Quic.cloud](http://Quic.cloud), and the other stuff.
Also enable a persistent object cache if you’re going to have logged in users. It will improve performance in logged in sessions. If Hostinger (also not a fan of them) has Redis, you can install Redis Object Cache. If not, SQLite Object Cache is a decent alternative (you have to enable the php-sqlite3 extension if it’s not already enabled).