Hi @derlehre , thanks for reaching out and for checking with LiteSpeed support.
Good news: Masteriyo already handles caching exclusions automatically for the account and learn pages. When LiteSpeed Cache is active, Masteriyo tells LiteSpeed not to cache the checkout, login, signup, lost-password, instructor-registration, learn, and account pages, so no configuration is needed for those.
The one part that isn’t automatic yet is the REST API. LiteSpeed Cache has Cache REST API enabled by default, which can cache dynamic API responses related to progress, enrollment status, and other data. This can result in stale or inconsistent information.
The exclusion LiteSpeed suggested is therefore the right approach. You can either:
- Disable LiteSpeed Cache → Cache → Cache REST API, or
- Add
/wp-json/masteriyo/v1/ under LiteSpeed Cache → Cache → Excludes → Do Not Cache URIs.
Either option is fine. Once this is configured, Masteriyo should work correctly with LiteSpeed Cache enabled. Let us know if you run into any issues afterward.
thank you dear @sauravkhanal
I don’t understand the caching concept very well. That’s why I’m describing more. Because there are three things. The first one is the Light Speed Web Server. The second thing is LS Cache. And the third one is Light Speed Cache plugin.
It means i can use Masteriyo Lms on a litespeed webserver and the server has LScache(server-level cache) on it?
-
This reply was modified 2 weeks, 1 day ago by
derlehre.
Or i can use Masteriyo on a server which has ServerLevel LSCache without LitespeedcachePlugin?
The plugin is needed only to turn off the restApi, otherwise, Masteriyo tell the ServerLevel Cache not to cache dynamic pages?
Good question. The short answer is yes, you’ll want the LiteSpeed Cache plugin installed.
Let me clarify my earlier reply, because I made it sound like Masteriyo could handle this on its own. The automatic exclusions only work when the LiteSpeed Cache plugin is active. Masteriyo checks for the plugin and uses it to tell LiteSpeed which pages shouldn’t be cached. Without the plugin, Masteriyo has no way to communicate those exclusions to the server-level cache.
The pages Masteriyo normally protects are:
- Checkout
- Sign-in / Sign-up
- Lost password
- Instructor registration
- Account
- Learn (course player)
Without those exclusions, a cached page can serve a stale nonce, which may cause issues such as login cookie-check errors or checkout submissions failing.
The plugin isn’t only needed for the REST API setting; it’s what makes the page exclusions work in the first place.
I’d recommend installing and activating LiteSpeed Cache. You don’t need to enable its optimization features, and I’d leave CSS/JS minification off since Masteriyo already ships optimized assets.
For the REST API, you can either:
- Turn off Cache REST API, or
- Add
/wp-json/masteriyo/v1/ under Do Not Cache URIs.
One extra note: if you’ve configured a Cart page, add that to the exclusions as well, since it isn’t part of Masteriyo’s automatic list.
It’s possible to run without the plugin by adding the exclusions manually through .htaccess or your vhost configuration, but that would be a manual setup we’d be unable to verify or maintain from our side. So the LiteSpeed Cache plugin is the approach we’d recommend.
@sauravkhanal Hello dear
I moved the website on a host which has litespeed webserver and also lscache on server. And installed the litespeed plugin and excluded Masteriyo pages and RestApi. Everything is working lightening fast. Thank you. I’m so happy to be able to run my website on a stronger host.