Soft2Hosting
WordPress Caching on Shared Hosting with LiteSpeed Cache: Page, Browser and Object Cache Settings
If your WordPress site runs on a LiteSpeed shared hosting plan, the LiteSpeed Cache plugin is the caching tool to use: page caching works out of the box once the plugin is active, browser caching and object caching are off until you turn them on, and a few purge settings decide whether visitors ever see stale pages. This guide goes through those settings with the plugin's documented defaults.
Our earlier post on page caching and mod_expires covers caching on plans without LiteSpeed. This one is specific to the LiteSpeed Cache plugin.
Which plan this applies to
On Soft2Hosting, Business Pro Hosting includes LiteSpeed with cache, and Enterprise Pro Hosting includes LiteSpeed with Redis cache. The plugin's server-side page cache needs a LiteSpeed web server, so on Starter Pro use the approach in our earlier post instead.
Three kinds of cache, three jobs
| Cache | What it stores | Plugin default |
|---|---|---|
| Page cache | The finished HTML of each page | On |
| Browser cache | Images, CSS, scripts and fonts on the visitor's device | Off |
| Object cache | Results of database queries and other expensive lookups | Off |
The WordPress developer reference explains why object caching is a separate setting: the core WP_Object_Cache keeps data in memory only for the current request and throws it away afterwards, unless a persistent cache drop-in is installed in wp-content. Without one, transients fall back to the options table in the database.
Step 1: Page cache settings
Under LiteSpeed Cache, Cache, the Cache tab has Enable Cache on by default. The documented defaults are:
- Cache Logged-in Users: on, stored as private cache per session.
- Cache Commenters: on.
- Cache REST API: on.
- Cache Login Page: off by default since version 7.9.
- Cache Mobile: off. Turn it on only if your theme serves different HTML to phones; a responsive theme does not need it.
The TTL tab sets how long cached copies last. Public pages, the front page, feeds and REST responses default to 604,800 seconds (one week), private cache to 1,800 seconds, and 403, 404 and 500 pages to 3,600 seconds. A value under 30 seconds means "do not cache". One week is fine because the plugin purges pages when content changes.
Step 2: Purge settings
- Purge All on Upgrade: off by default, but the documentation recommends turning it on, since a plugin or theme update can change any page.
- Auto Purge Rules for Publish/Update: choose which related pages are purged when you publish, such as the front page, categories, tags and archives. "All pages" is off by default.
- Serve Stale: off. On a busy site, turning it on lets visitors get the last copy while a new one is built, which reduces load spikes after a purge.
On the Excludes tab, add pages that must never be cached, typically cart, checkout and my-account pages on a WooCommerce shop if your WooCommerce settings do not already handle them.
Step 3: Browser cache
Browser Cache is off at plugin level. Turn it on, and the default TTL is 31,557,600 seconds (one year), with a 30-second minimum. A long TTL is safe for theme files that change names when updated; if you replace images under the same file name, either rename them or lower the TTL.
Step 4: Object cache with Redis (Enterprise Pro)
The Object tab is off by default. The plugin documentation is clear that LiteSpeed Cache does not provide object caching itself; it connects to an external cache such as Memcached, LSMCD or Redis. To use the Redis cache on Enterprise Pro:
- Set Object Cache to On and Method to Redis (the default method is Memcached).
- Enter the host and port your hosting account provides. Defaults are localhost and 11211, which is a Memcached port; for a UNIX socket, enter the socket path as host and 0 as port. Ask support for the right values for your account.
- Leave Persistent Connection on.
- Cache WP Admin is on by default and speeds up the dashboard, but the documentation warns it may occasionally show stale data. Turn it off if admin screens look out of date.
- Save, then check that the connection test shows as passed.
Do not run a second object cache plugin alongside it; two plugins fighting over the same drop-in file cause errors.
Check that it works
- Open a page in a private window, reload it, and check the response headers in the browser's developer tools for a LiteSpeed cache hit header.
- Edit a post and confirm the change appears without a manual purge.
- After enabling the object cache, watch the admin dashboard for a day for stale data or errors.
Mistakes to avoid
- Running LiteSpeed Cache together with another page caching plugin.
- Caching cart and checkout pages on a shop.
- Entering the wrong Redis port and leaving the object cache failing silently.
- Leaving Purge All on Upgrade off, then seeing broken layouts after a theme update.