Skip to content

Installing the LSCache module on a cPanel + LiteSpeed server

How to install and verify the LSCache module on a cPanel host running LiteSpeed Web Server, configure server-wide cache storage, and confirm WordPress accounts pick it up automatically through the LSCache WP plugin.

LSCache is LiteSpeed’s full-page cache, comparable to Nginx FastCGI cache but managed inside LSWS rather than as a reverse proxy layer. On a cPanel + LiteSpeed host, LSCache + the LSCache WP plugin is the highest-leverage performance win for WordPress accounts. The module ships with LSWS but the storage directory and the cache policy need explicit setup; without those, the LSCache WP plugin loads but caches nothing.

What’s happening

LSCache stores fully-rendered HTML responses keyed by URL + cookie state. When a request arrives, LSWS checks the cache before invoking PHP at all — if there is a hit, the response is served from disk in microseconds. The cache module needs a storage path with enough disk space and the right ownership, and a cache root directive in the LSWS config. The LSCache WP plugin uses the LSWS-provided ESI tag conventions to mark logged-in users (uncached) versus anonymous (cached), without operator intervention.

How to verify

Check what is in place:

/usr/local/lsws/bin/lshttpd -v
ls /usr/local/lsws/cachedata/ 2>/dev/null
grep -i "lscache\|cacheroot" /usr/local/lsws/conf/httpd_config.conf
curl -sI https://example.com/ | grep -i "x-litespeed-cache"

The curl is the most telling: a response from LSCache contains X-LiteSpeed-Cache: hit or miss. If the header is absent entirely, the module is not engaged for that vhost.

The fix

  1. Confirm LSWS Enterprise or LSWS Open Source 1.7+ is installed (LSCache is included in both). lshttpd -v should match.
  2. Create the cache storage directory: mkdir -p /usr/local/lsws/cachedata && chown nobody:nobody /usr/local/lsws/cachedata && chmod 755 /usr/local/lsws/cachedata. cPanel + LSWS runs as nobody:nobody for the LSWS master; ownership matters because LSWS writes cache entries as that user.
  3. LSWS Admin (https://example.com:7080/) > Server Configuration > General > Cache Storage Root > set to /usr/local/lsws/cachedata. Graceful restart LSWS.
  4. Confirm the module loaded: at LSWS Admin > Service Manager, the cache module should show as enabled. The shorthand check: curl -sI https://any-vhost/ returns an X-LiteSpeed-Cache header now even if it is miss.
  5. For each WordPress account on the server, the customer installs the LSCache WP plugin from the WordPress plugin directory. The plugin auto-detects the LSWS cache module and starts caching anonymous responses immediately. Logged-in users bypass the cache.
  6. Validate cache hits. Open an anonymous browser, hit the home page twice, check the response header: first request X-LiteSpeed-Cache: miss, second request hit. If the second hit is still a miss, the LSCache WP plugin is not configured (Cache > Cache > Enable Cache must be On).

For environments where LSCache is the standard performance baseline, Stack Harbor confirms its activation on every WordPress account during onboarding under cPanel server administration.