![]() |
|
Guide LiteSpeed Cache on CyberPanel: Settings That Matter (and One That Does Nothing) - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels) +--- Forum: CyberPanel (https://adminsforum.com/Forum-cyberpanel) +---- Forum: CyberPanel Guides & Tutorials (https://adminsforum.com/Forum-cyberpanel-guides-tutorials) +----- Forum: CyberPanel WordPress & LSCache Guides (https://adminsforum.com/Forum-cyberpanel-wordpress-lscache-guides) +----- Thread: Guide LiteSpeed Cache on CyberPanel: Settings That Matter (and One That Does Nothing) (/Thread-guide-litespeed-cache-on-cyberpanel-settings-that-matter-and-one-that-does-nothing) |
LiteSpeed Cache on CyberPanel: Settings That Matter (and One That Does Nothing) - JAY - 11-07-2026 LiteSpeed Cache on CyberPanel: Settings That Matter (and One That Does Nothing) If you installed WordPress with our WP-CLI guide, the LiteSpeed Cache plugin is already there, and page caching is on as soon as it's active. You don't need to change much. But it's worth knowing how to check it really works, which settings to leave alone, and that one popular setting does nothing on OpenLiteSpeed. We tested everything on CyberPanel 3.0.8 with OpenLiteSpeed 2.5.5 and LiteSpeed Cache 7.9.2. What the cache does: real numbers We timed our WordPress home page from the server (time to first byte, median of 6 requests): Code: Cache OFF: 289 ms
First visit after a purge (miss): 358 ms
Cache ON (hit): 63 msStep 1: Check that pages come from the cache Over SSH (or any computer with curl), ask for a page twice: Code: curl -sI https://yourdomain.com/ | grep -i x-litespeed-cache
curl -sI https://yourdomain.com/ | grep -i x-litespeed-cacheNo x-litespeed-cache header at all? First check the page really exists. We lost time on this ourselves: our test page Code: /sample-page/Code: /index.php/...Code: cache-control: private, no-cacheStep 2: The Cache tab (leave the defaults) Go to LiteSpeed Cache → Cache. Our fresh install had:
Step 3: Browser Cache does nothing on OpenLiteSpeed The Browser tab has a Browser Cache switch with a 1-year TTL, and a notice saying OpenLiteSpeed users should check custom headers. We tested what it actually does. With the switch OFF, our CSS and image files were already sent with Code: cache-control: public, max-age=604800With the switch ON, the plugin wrote one-year Code: ExpiresByTypeCode: .htaccessCode: max-age=604800Code: .htaccessCode: .htaccessThe setting that does work is in CyberPanel. Open Websites → your site → Config → vHost Conf, add this block at the very end, and click Save configuration: Code: expires {
enableExpires 1
expiresByType image/*=A31536000, text/css=A31536000, application/javascript=A31536000, font/*=A31536000
}Then restart OpenLiteSpeed over SSH: Code: /usr/local/lsws/bin/lswsctrl restartCode: cache-control: public, max-age=31536000Code: curl -sI https://yourdomain.com/wp-includes/css/dist/block-library/style.min.css | grep -i cache-controlCode: style.min.css?ver=6.xStep 4: Purging the cache After big changes (a new theme, changed menus or widgets, or a page that looks out of date), clear the cache. In WordPress: LiteSpeed Cache → Toolbox → Purge → Purge All, or the LiteSpeed icon in the top admin bar. Over SSH you can do the same with WP-CLI (we got Success: Purge all sent to the web server): Code: wp --allow-root --path=/home/yourdomain.com/public_html litespeed-purge allWhat we didn't change
Have a site that never shows hit? Reply below with the output of the curl command from step 1 (hide your server IP and domain if you prefer). |