In the past I achieved a 93% improvement of website speed when I compared a UK based web host running Apache with a UK host running LiteSpeed with caching, but in this post I’m going to show you all the LiteSpeed Cache settings I use with Divi on WordPress.
Here are the load times of this website’s homepage in milliseconds, according to Pingdom:
All Divi performance improvements active but no caching
Divi performance improvements active + LiteSpeed cache enabled
That’s an 89% speed improvement between Divi on LiteSpeed with no caching and Divi on LiteSpeed with active caching.
So, here are the LiteSpeed Cache plugin settings I’ve found work well with Divi. It must be said that every website is unique so some of the settings below may break features you use, or you may be able to use some features I have turned off, so make sure you test things as you go.
General Settings tab
- Automatically Upgrade: off
Updating plugins risks introducing bugs so for most plugins it’s better to update manually then check the site. Updating also flushes the cache, temporarily slowing down the website, so it’s better to update all plugins and themes in one sitting rather than have them spread out, each one resetting the cache every time.
- Domain Key: click the button to request a domain key
- Guest mode: on
- Guest Optimization: on
- Server IP: set this to the IP your website is hosted at
- Enable Cache: on
- Cache Logged-in Users: on
- Cache Commenters: on
- Cache REST API: on
- Cache Login Page: on
- Cache favicon.ico: on
- Cache PHP Resources: on
- Cache Mobile: on
You may not have unique content that’s only served to mobile devices but this feature is used for AMP, the CCSS and UCSS services and it’s required if you have Guest Mode + Guest Optimization enabled
- Purge All On Upgrade: on
- Auto Purge Rules For Publish/Update: tick all pages on which content will change when a new post or page is published, for e.g the homepage if it contains a feed of the latest blog posts.
- Serve Stale: on
My host doesn’t allow automatically scheduled crawling in LiteSpeed so I don’t have scheduled purge turned on, but you can configure that here if you like.
- Browser Cache: on
- Browser Cache TTL: 2592000 (this is in seconds = 4 weeks and 2 days)
- Instant Click: on
Image Optimization Settings
- Auto Request Cron: on
- Auto Pull Cron: on
- Optimize Original Images: on
- Remove Original Backups: off
- Optimize Losslessly: on
- Preserve EXIF/XMP data: off
- Create WebP Versions: on
- Image WebP Replacement: on
- WebP For Extra srcset: on
This helps catch every instance in which Divi uses images on a page
- WordPress Image Quality Control: 82
You can set it higher but it probably won’t make a visible difference.
After setting everything up in the Image Optimization Tab make sure you come back to the Image Optimization Summary tab to kick off the actual process. This will get WordPress to start sending your images to LiteSpeed’s servers for them to generate WebP versions that they’ll send back for your website to serve to users.
CSS Settings tab
- CSS Minify: on
- CSS Combine: off
- Generate UCSS and UCSS Inline: off
They won’t be used when combine is off anyway
- CSS Combine External and Inline: on
- CSS HTTP/2 Push: on
- Load CSS Asynchronously: on
- CCSS Per URL: on
This is important for theme builders like Divi
- Inline CSS Async Lib: on
- Font Display Optimization: swap
JS Settings tab
- JS Minify: on
- JS Combine: on
- JS Combine External and Inline: off
- JS HTTP/2 Push: on
- Load JS Deferred: off
HTML Settings tab
- HTML Minify: on
- DNS Prefetch: //fonts.googleapis.com
- DNS Prefetch Control: on
- Remove Query Strings: off
- Load Google Fonts Asynchronously: on
- Remove Google Fonts: off
Unless you’re not using Google Fonts, of course, in which case turn them off in Divi settings too
- Remove WordPress Emoji: off
- Remove Noscript Tags: off
Media Settings tab
- Lazy Load Images: on
- Responsive Placeholder: on
- LQIP Cloud Generator: on
- LQIP Quality: 6
- LQIP Minimum Dimensions: 150 × 150
- Generate LQIP In Background: on
- Lazy Load Iframes: on
- Add Missing Sizes: on
- Inline Lazy Load Images Library: on
- Viewport Images: on
- Viewport Images Cron: on
Media Excludes tab
- Lazy Load Image Excludes: add any recurring images to this field, e.g logo. Partial strings can be used, like ‘logo’ for all versions of a logo image instead of full file paths.
Follow these instructions at your own risk. Carry out a full database backup first. You have been warned.
DB Optimization Settings tab
- Revisions Max Number: 10
- Revisions Max Age: 7
Click the following blocks to clear the corresponding bloaty elements from database:
- Post Revisions
- Expired Transients
- Optimize Tables
Scroll down to the Database Table Engine Converter table and click the ‘Convert to InnoDB’ link for all db tables shown. Annoyingly the page will refresh after each click.
The first couple of times you load each page of your website it’ll be slower as the host will have to pull everything together. Once it’s done that it’ll start calculating critical CSS, combining scripts etc and saving cached copies of everything, whereafter things will speed up nicely.
Remember to back up before and test, test, test as you go.