Skip to content
EN

LiteSpeed Cache for WordPress

Set up the free LiteSpeed Cache plugin for WordPress across cache, images, page optimization and database, with the settings to turn on.

Updated

LiteSpeed Cache is a free cache plugin for WordPress. Once it is set up, your website has page cache, browser cache, minified CSS and JS, WebP images, pages loaded ahead on hover, and a leaner database.

The video has no voice. The tables below write out the notes on screen and the state of each setting in the video, in four parts:

Part Time in the video
Cache Control Settings 00:00
Image optimization 02:04
Page optimization 02:49
Database optimization 04:19

Anything not listed is left at its default in the video.

What do you need to get ready?

  • A WordPress website on a LiteSpeed or OpenLiteSpeed server. The page cache of LiteSpeed Cache needs this server, or the QUIC.cloud CDN. On Apache or Nginx the plugin still runs its general optimizations, such as image optimization and CSS and JS minification. The site in the video runs on AZDIGI cPanel hosting (LiteSpeed).
  • The LiteSpeed Cache plugin, installed and activated.
  • ShortPixel, if you want WebP images as in the video.

Part 1: set up the cache

Go to LiteSpeed Cache > Cache. Click Save Changes after each tab.

Tab Setting In the video
[1] Cache Enable Cache On
[1] Cache Cache Logged-in Users Off
[1] Cache Cache Commenters, Cache REST API On
[1] Cache Cache Login Page Off
[1] Cache Cache favicon.ico, Cache PHP Resources On
[1] Cache Cache Mobile Off
[2] TTL Public, Front Page, Feed, REST TTL 604800 seconds (1 week)
[2] TTL Private Cache TTL 1800 seconds (30 minutes)
[3] Purge Purge All On Upgrade On
[3] Purge Serve Stale Off
[5] ESI Enable ESI Off
[7] Browser Browser Cache On, TTL 31557600 seconds (1 year)
[8] Advanced Improve HTTP/HTTPS Compatibility On
[8] Advanced Instant Click On

The notes on screen explain the main choices:

  • Logged-in users need no cache, which avoids errors with page builders.
  • Turning off Cache Login Page lets you log in without the “Expired” error.
  • Browser Cache lets web browsers cache your blog content.
  • Instant Click loads a page ahead when the reader moves the pointer over its link, so pages load faster.

In tab [3] Purge, Auto Purge Rules For Publish/Update has these ticked: Front page, Home page, Pages, All pages with Recent Posts Widget, Author archive, Post type archive, Monthly archive, Term archive. So when you publish or update a post, the related pages are refreshed.

Part 2: optimize images

Go to LiteSpeed Cache > Image Optimization, tab Image Optimization Settings:

Setting In the video
Image WebP Replacement On
WebP For Extra srcset On
WordPress Image Quality Control 82

Turn on WebP when you use ShortPixel to create the WebP image files.

Part 3: optimize pages

Go to LiteSpeed Cache > Page Optimization. LiteSpeed warns at the top of this page: test carefully when you turn on any option, and Purge All once after you change the Minify or Combine settings.

Tab Setting In the video
[1] CSS Settings CSS Minify On
[1] CSS Settings CSS Combine, Unique CSS, CSS HTTP/2 Push, Load CSS Asynchronously Off
[1] CSS Settings Font Display Optimization Swap
[2] JS Settings JS Minify, Load JS Deferred On
[2] JS Settings JS Combine, JS HTTP/2 Push Off
[2] JS Settings Load Inline JS Default
[3] Optimization Settings HTML Minify, Inline CSS Minify, Inline JS Minify Off
[3] Optimization Settings DNS Prefetch Control, Remove Comments, Remove Query Strings Off
[3] Optimization Settings Load Google Fonts Asynchronously, Remove Google Fonts Off
[3] Optimization Settings Remove WordPress Emoji On
[4] Media Settings Lazy Load Images Off
[4] Media Settings Responsive Placeholder On
[7] Tuning Settings Combined CSS Priority, Combined JS Priority Off

The video only minifies CSS and JS; it does not combine them.

Part 4: optimize the database

Go to LiteSpeed Cache > Database, tab DB Optimization Settings:

Setting In the video
Revisions Max Number 3
Revisions Max Age 30 days

Keep at most 3 revisions so the database stays lean, and keeping them for 30 days is enough.

How do you know LiteSpeed Cache works?

Log out of the admin account, since logged-in users are not cached. Open the website as a reader and hover over a link: with Instant Click, that page loads ahead and opens almost the moment you click.

Type to search…

↑↓ navigate↵ selectEsc close