Best configuration settings for Litespeed Cache

Last edited:
November 1, 2023
Reading time:
6 mins

/

Blog

/

Speed

/

Best configuration settin...

đź’ˇWe may earn a commision if you subscribe to a service from a link on this page.

LiteSpeed Cache (LSCache) is a powerful caching plugin designed to boost the performance of WordPress websites by improving page load times and reducing server load. As one of the most efficient caching solutions available, LSCache offers a wide range of configuration options to fine-tune its performance. Let’s explore the best configuration settings for LiteSpeed Cache to maximize your website’s speed and user experience.

💡 Disclaimer: We are not connected, affiliated, sponsored or partnering with Litespeed® in any way. This is just a tutorial for informational purposes, aiming to review the plugin and present a suggested setup for your WordPress website.

First things first, only for Litespeed or Openlitespeed

While LiteSpeed Cache (LSCache) is a highly recommended caching solution for LiteSpeed and OpenLiteSpeed web servers, websites hosted on non-LiteSpeed servers require alternative caching solutions to achieve optimal performance So make sure to check your server is running one of those. Learn how to check what web server type your server is using in another article.

System setup for the configurations

We have checked the recommendations for various projects, with similar system settings. The below settings apply to all Shared Hosting plans, VPS and Dedicated Servers with fewer than 4-6 cores, and lower than 8GB-16GB ram. With more power, maybe some more features can be utilized, but we believe the following are the best configuration settings for low to mid range hosting. Also, CDN services, as well as Image and Database Optimization are not taken into consideration, as those could require completely independent approach depending on the admin’s preferences and can be handled or managed outside of Litespeed plugin. So, the principle is “what can be handled outside of Litespeed plugin, stays out of the plugin”.

General settings

General Tab
Automatically Upgrade – OFF
Guest mode – OFF
Guest Optimization – OFF
Notifications – OFF

Tuning Tab
Leave the default settings

Cache settings

Cache Tab
Enable Cache – ON
Cache Logged-in Users – ON
Cache Commenters – ON
Cache REST API – ON
Cache Login Page – ON
Cache favicon.ico – ON
Cache Commenters – ON
Cache PHP Resources – ON
Cache Mobile – OFF

TTL Tab
Leave the default settings

Purge Tab
Leave the default settings

Exlcudes Tab
Leave the default settings

ESI Tab
Leave the default settings

Object Tab
Object Cache – ON
Method – YOUR PREFERRED

Object Tab
Persistent Connection – ON
Cache WP-Admin – ON
Store Transients -ON

Browser Tab
Browser Cache – ON
Browser TTL Cache – 31557600

Advanced Tab
Leave the default settings

Page Optimization

On Page Optimization, LScache gives as the ability to minify and combine JS, CSS and HTML files. Our preferred choice is to minify but not combine files. That is because combining takes a little more time and resources to achieve, while at the same time you don’t have the freedom to manage every script according to your needs (e.g. prioritize their loading per your likings).

CSS Settings Tab
CSS Minify – ON
CSS Combine – OFF
Generate UCSS – OFF
UCSS Inline – OFF
CSS Combine External and Inline – OFF
Load CSS Asynchronously – OFF

JS Settings Tab
JS Minify – ON
JS Combine – OFF
JS Combine External and Inline – OFF
Load JS Deferred – Deferred

We prefer to Load the JS as Deferred, but always check everything works as expected in your website. If you encounter issues, make sure you change that setting or add your JS files that produce errors in the

HTML Settings Tab
HTML Minify – ON
DNS Prefetch Control – OFF
Remove Query Strings – OFF
Load Google Fonts Asynchronously – OFF
Remove Google Fonts – OFF
Remove WordPress Emoji – OFF
Remove Noscript Tags – OFF

Media Settings Tab

In order to utilize Lazy Load, make sure your theme (or any other plugin) does not Lazy Load the images, because that could cause performance issues. It is recommended to apply lazy loading outside of Litespeed plugin, but in case you you are sure the only mechanism you have for lazyloading is LScache plugin’s feature, then the settings should be the following:

Lazy Load Images – ON
Basic Image Placeholder – Default
Responsive Placeholder – OFF
Responsive Placeholder SVG – Default
Responsive Placeholder Color – Default
LQIP Cloud Generator – OFF
LQIP Quality– Default
LQIP Minimum Dimensions – Default
Generate LQIP In Background – Default
Lazy Load Iframes– OFF
Add Missing Sizes – OFF

Media Excludes Tab

This tab is only used when Lazy Load is active (ON). You should add in the excludes classes the class of every media that get’s displayed above the fold, such as the header logo and the header banner. This is very theme and website design specific, so you should make a quick check on your website to discover the classes of media above the fold.

Examples:
Lazy Load Image Excludes – header-logo-class
Lazy Load Image Parent Class Name Excludes – homepage-banner-class

Configure your LScache!

Configuring LiteSpeed Cache with the best settings according to your setup can significantly improve the performance and loading speed of your WordPress website. By enabling caching, leveraging browser cache and optimizing CSS and JavaScript delivery, you can enhance user experience, boost search engine rankings, and reduce server load. However regularly monitoring your site’s performance and testing different configurations will help you fine-tune LSCache settings even more, in order to meet the specific needs of your website.