Skip to content
WordPress

How to Speed Up WordPress With LiteSpeed Cache

In this article10 sections

A slow WordPress site loses visitors before they read a word, and search engines notice. Most of the time is spent building each page from PHP and the database on every visit. Caching stores the finished page, so the next visitor gets it in milliseconds. On a LiteSpeed server, the LiteSpeed Cache plugin can do this at the web server level, which is faster than a plugin that caches inside PHP. This guide shows how to set it up correctly, which settings matter, and how to check that the cache is really working.

SiteHarbour’s WordPress hosting plans run on LiteSpeed servers with LSCache, and every plan includes object caching and a Cloudflare CDN. The plugin is what turns those server features on for your site.

Before you start

  • Take a backup. Caching changes how pages are served, so keep a copy you can restore, as shown in how to back up and restore a cPanel account.
  • Test on staging first if the site earns money. Minification can break a theme’s JavaScript. The steps for a staging copy are in how to set up a WordPress staging site.
  • Check the server. The plugin’s full feature set works only on LiteSpeed. Confirm the server type with the response header in Step 5.

Step 1: Install and activate the plugin

In the WordPress dashboard, open Plugins > Add New, search for LiteSpeed Cache, and select Install Now, then Activate. Install one caching plugin only. Two plugins that both cache pages make each other’s work harder and cause stale content.

Step 2: Turn on the page cache

Open LiteSpeed Cache > Cache > Cache Settings. Check that Enable Cache is on, and that the cache is set for both logged-in and logged-out visitors. Logged-in caching is off by default, which is safe. Leave it off unless your site has no member areas, because a cached page can show one user’s details to another.

Expected: the cache status in the admin bar shows the page was cached on the next visit. Load the same page twice and compare the load times in your browser’s network tab.

Step 3: Set the cache lifetime and purge rules

The default time to live is usually right for most blogs. A news site or a store needs shorter times, or a purge rule that clears the cache when a product changes. Under Purge Settings, enable the option that clears the post’s page and the home page when a post is published or updated. Without it, new posts take longer to appear on the home page.

Step 4: Enable object caching and the database cleanup

Object caching stores database query results. On a SiteHarbour WordPress plan it is included, so turn it on under Cache > Object, and choose the object cache option that your plan provides. Then run the database cleanup once, from Database, after you have a backup. It removes revisions and transients that pile up over years. Schedule it monthly rather than running it every day.

Step 5: Confirm the cache works

From a terminal, request a page and look at the response headers:

curl -sI https://example.com/ | grep -i x-litespeed

Expected: a header such as x-litespeed-cache: hit on the second request, or miss on the first. If there is no LiteSpeed header, the server is not LiteSpeed, and the plugin falls back to less capable modes. Ask your host which server runs the site.

Step 6: Test the minification and the CDN

Under Page Optimization > CSS and JS, turn on minification one option at a time. After each change, load the front end and the checkout or form pages, and check the browser console for errors. A JavaScript error after minification usually means you need to exclude one file, not turn off the whole option.

If your plan includes the Cloudflare CDN, check that the plugin’s Cloudflare settings match the zone. A mismatch means cached pages do not clear when you update content.

Step 7: Measure the result

Run a speed test before and after the changes, on the same page, from the same location. Track time to first byte and the total load time. Look for a clear drop in time to first byte, because that is what the cache changes. If the number barely moves, the bottleneck is likely in the images or a slow plugin, covered in why is my WordPress website slow.

Common mistakes

  • Two caching plugins. Remove one. Both serving the same page is worse than either alone.
  • Caching logged-in users. A shopping cart or account page can leak to the next visitor. Keep those pages excluded.
  • Turning on every optimization at once. Change one at a time, so you know which one broke the page.
  • Forgetting purge rules. A cached home page that never updates looks like a broken site.

Frequently asked questions

Do I still need a CDN with LiteSpeed Cache?

A CDN helps visitors far from the server, because it stores static files close to them. It does not replace the page cache, and the two work well together.

Will caching break my contact form?

Not if the form page is excluded from the cache. Check the form after you enable caching, because a cached form can show a stale security token.

How much faster will my site be?

It depends on the theme and plugins. Measure your own site before and after. Cached pages are usually much faster, but a site with heavy images or slow scripts also needs those fixed.

Is object caching needed for a small blog?

Not always. It helps most on sites with many database queries, such as WooCommerce stores, membership sites and large archives.

A page cache is the single biggest speed gain for most WordPress sites. Turn it on, set the purge rules so updates appear at once, check the cache header, and add minification one step at a time. Then measure time to first byte before and after. For the causes of slowness the cache cannot fix, read slow WordPress on cPanel: 5 checks and fixes.

Share this guide