Turning on LiteSpeed Cache for WordPress
PrintLiteSpeed Cache (LSCache) keeps ready-made copies of your WordPress pages and hands them to visitors without running PHP and database queries each time. Pages load faster and your account uses fewer resources.
Which plans it works on
The plugin's page cache depends on the LiteSpeed web server. At TopHost, LiteSpeed runs on the WordPress Hosting and Business Hosting plans. Web Hosting SSD plans use Nginx and Apache, so the plugin cannot cache pages on the server there; use a different caching plugin on those plans. More background: What LiteSpeed is and how it helps your website.
Two things before you start
- Back up the site, for example with WP Toolkit or JetBackup.
- Deactivate and delete any other caching plugin, such as WP Rocket, W3 Total Cache or WP Super Cache. Two caches at once lead to stale or broken pages.
Switch the cache on
On WordPress plans the plugin may already be there, so look under Plugins first. If it is missing:
- Go to Plugins, then Add New.
- Type LiteSpeed Cache into the search box and install it with Install Now, followed by Activate.
- Open the new LiteSpeed Cache menu and choose Cache.
- Check that Enable Cache is ON and click Save Changes.
The defaults are designed to be safe for most sites, so leave everything else as it is for now.
Confirm it is caching
- Open your site in a private browser window. Signed-in users are not served cached pages by default, so testing while logged in proves nothing.
- Press F12, switch to the Network tab and reload.
- Click the first request (the page itself) and look for the
x-litespeed-cacheresponse header.
A miss on the first load is expected; the page has just been stored. Reload once more and it should say hit.
Optional speed-ups
The Page Optimization section offers more gains, but some themes do not cope well with them. Turn on one option, save, check a few pages, then move to the next.
- CSS Minify and JS Minify shrink files and are usually harmless.
- CSS Combine and JS Combine merge files and are the usual suspects when menus or sliders stop working.
- Lazy Load Images delays images until the visitor scrolls. Exclude the large image at the top of the page, or it will appear late.
The plugin is free. A few features, such as image optimization, rely on the external QUIC.cloud service, whose free quota is limited.
Stores and Cloudflare
WooCommerce: the cart, checkout and customer account pages are left out of the cache by default. Place a test order anyway after switching it on.
Cloudflare: the two work together, but purge the Cloudflare cache as well after major changes.