The Ideal LiteSpeed Cache Settings + CDN

The Ideal LiteSpeed Cache Settings + CDN (2021)

In this guide, we’re configuring LiteSpeed Cache + with the best settings.

If you don’t have a LiteSpeed server yet, I like NameHero’s Turbo Cloud plan which includes 3GB RAM + NVME. There’s no reason you should be using any other plugin than LiteSpeed Cache since it has excellent reviews, extensive settings, and uses faster server-level caching.

You should also be using’s CDN which is free and was built specifically to work on top of LiteSpeed. It should give you better results than Cloudflare, StackPath, and other CDNs.

Head to the quick settings if you ‘re looking for an easy setup, otherwise I’ll walk you through nearly every part of the LiteSpeed Cache settings, from Page Optimization to CDN.

  • ON – enable.
  • OFF – disable.
  • TEST – test your own results.
  • CONSUME RESOURCES –  indicates the setting may consume more server resources which can lead to 5xx errors + CPU overages on shared hosting and less powerful servers.


1. Quick Settings

For a quick setup, leave all the LiteSpeed Cache settings as-is and only change the following. This setup should be fine for most WordPress sites so you don’t have to read this entire guide.

  1. General settings → request domain key.
  2. Link to after enabling CDN.
  3. General settings → guest mode → On.
  4. General settings → enter your server’s IP address.
  5. Cache → disable cache logged-in users + commenters.
  6. Cache → enable cache mobile if you’re using guest mode.
  7. Cache → object → Enable memcached or redis (I like redis).
  8. Cache → object → disabled cache wp-admin (you can test this).
  9. Activate redis or memcached extension in cPanel (see instructions).
  10. Cache → browser → browser cache → On.
  11. CDN → CDN → On.
  12. Sign up for and login to dashboard.
  13. dashboard → CDN → enable CDN.
  14. Use CNAME record for setting up
  15. Copy address provided by
  16. Login to cPanel → Zone Editor → Manage.
  17. Change www domain record to address.
  18. Enable static cache + QUIC Backend in
  19. Test to make sure it’s working and test results.
  20. Image optimization summary → do this after configuring settings.
  21. Image optimization settings → auto request cron → On.
  22. Image optimization settings → optimize losslessly → On.
  23. Image optimization settings → preserve EXIF/XMP data → Off.
  24. Image optimization settings → image WebP replacement → On.
  25. Image optimization settings → WebP for extra srcset → On.
  26. Page optimization → minify HTML, CSS, JS → On.
  27. Page optimization → load CSS asynchronously → test.
  28. Page optimization → load JS deferred → deferred (test).
  29. Page optimization → DNS prefetch → prefetch third-party domains.
  30. Page optimization → DNS prefetch control → On.
  31. Page optimization → lazy load images → On.
  32. Page optimization → lazy load iframes → On.
  33. Page optimization → add missing sizes → On.
  34. Page optimization → inline lazy load images library → On.
  35. Page optimization → gravatar cache + cron → On.
  36. Database → clean your database once in a while.
  37. Database → revisions max number → 10 is fine.
  38. Toolbox → heartbeat → enable all, then 120, 0, 60 respectively.


2. Dashboard

LiteSpeed’s Dashboard shows the status of optimized images, CDN usage, CSS, etc. Measuring your PageSpeed scores here is more accurate than third-party browser tools such as GTmetrix.


3. General

  • Automatically Upgradeenable – likely maintained well enough to do this.
  • Domain Key – request a domain key and add it here, then link to
  • Guest Mode – enable – significantly improves load time for first time visitors by saving time reading cookies, looking for cache varies, and processing ESI. You can read more about Guest Mode + Guest Optimization here, but it has great feedback in Facebook Groups. Consumes resources if crawling is enabled. Doesn’t work with Cloudflare APO.
  • Guest Optimization – enable – aggressive page/image optimization for first time visits.
  • Server IP – use the tool in LiteSpeed Cache to paste your server’s IP address.
  • Notificationsenable – you want notifications from LiteSpeed (i.e. new releases).

LiteSpeed Cache General Settings


4. Cache


  • Enable CacheOn.
  • Cache Logged-in UsersOff – only enable if you run a membership website or need caching in the admin for users logging into your site, otherwise it consumes resources.
  • Cache Commenters Off – creates a separate cache for people who left a comment which is still pending, but also consumes resources if your blog gets lots of comments.
  • Cache Rest API – On – used for many themes, plugins, and the WordPress Block Editor.
  • Cache Login PageOn – saves server resources since the login page is a common target. Don’t change the login URL since LiteSpeed + optimize the default login page.
  • Cache favicon.icoOn – caches favicon (the small logo image shown in the browser tab).
  • Cache PHP Resources On – caches static PHP files (i.e. CSS + JS) loaded by your theme. Only disable if you have dynamic CSS + JavaScript loaded in PHP, which you likely don’t.
  • Cache MobileDepends – only enable if you serve different content on mobile/desktop, or use AMP, CCSS, UCSS, or Guest Mode and Guest Optimization (consumes resources). Since I recommend Guest Mode + Guest Optimization be turned on, this would also be on.
  • Cache URIs – not necessary for most websites since the “cache logged-in users” setting handles private cached URIs, and no pages on your site generally need to be force cached.
  • Drop Query String – marketing campaigns and tracking URLs often contain query strings where caching is ignored. The default list is usually fine, but if you have others, add them.

LiteSpeed Cache Cache Settings


  • Cache TTL – default settings are usually fine. Cache TTL is the amount of time LiteSpeed Cache keeps a cached file. Once it expires, it will create a new one. A shorter TTL is only needed if you update your site frequency and want to guarantee visitors will see the new cached version, but this will also consume more resources. A long TTL will save resources, but the cache won’t be refreshed as frequently, so visitors might not see the new content.

LiteSpeed Cache TTL Settings


  • Purge All On Upgrade – On – purges cache when WordPress core/themes/plugins are upgraded to make sure your site displays properly. LiteSpeed says to leave this on as well.
  • Auto Purge Rules For Publish/Update – default settings are OK. When you publish a post, your blogroll and other content may need to update, so they should also be purged.
  • Serve StaleOff – when turned on, the most recently purged (stale) copy of the page is served if the new cached version isn’t generated yet (enabling this consumes resources).
  • Schedule Purge URLs – no need to add URLs here unless you need pages purged at specific time (during low traffic), in which case you would also set a schedule purge time.
  • Purge All Hooks – default settings are fine. When specific hooks are run, it will purge all. LiteSpeed says adding comment_post may be good to purge all when a comment is made.

LiteSpeed Cache Purge Settings


Nothing to do here for nearly most sites. You’re already controlling the cache in other settings, so there’s usually no reason to exclude specific things from the cache unless you have a reason.


  • Enable ESIOff – controls how specific elements on your dynamic pages are cached, whether it be publicly, privately, with a custom TTL, etc. Complicates things (LiteSpeed says it’s easier for a server to return full pages without messing with this). Since ESI is off, there’s no need to change settings for admin bar, comment form, Nonces, or Vary Group.

LiteSpeed Cache ESI Settings


  • Object Cache – On – caches your database. I prefer Redis over memcached, but which one’s ‘best’ is debatable. To pass the connection test, enable Redis or memcached in your hosting account (only one). In cPanel, this is in Select PHP Version → Extensions, then enable the Redis or memcached extension. Save changes and recheck the connection test.
  • MethodRedis if that’s the extension you enabled in your host, otherwise memcached.
  • Host – leave as localhost.
  • Port – leave as the default port.
  • Default Object Cache Lifetime – 360s is fine.
  • Username/Password – leave as-is (not needed).
  • Redis Database ID – leave unless you use Redis and need a different ID.
  • Global Groups – leave as-is (groups that should be cached at network level).
  • Do Not Cache Groups – leave unless you want to add groups excluded in object cache.
  • Persistent Connection – On – connection is kept alive and can make Memcached faster.
  • Cache WP-AdminOff – using object cache inside the admin can sometimes have a negative effect on the speed of the admin. You can test it, but I would usually leave it off.
  • Store Transients – On – recommended by LiteSpeed to get server status notifications.

LiteSpeed Cache Object Cache Settings

NameHero RedisActivate Redis or memcached in your cPanel


  • Browser Cache  – On – not sure why this isn’t enabled by default.
  • Browser Cache TTL31557600 – recommended by Lighthouse to serve static assets with an efficient cache policy. This tells browsers how long the cache should be stored for.

LiteSpeed Cache Browser Settings


  • Login Cookie – leave as-is (only needed if you have multiple WordPress installs and need the cache to distinguish who is logged into which WordPress site, not used for a multisite).
  • Improve HTTP/HTTPS CompatibilityOff – only enable if you’re using both HTTP and HTTPS and are noticing issues with the cache. You can also try forcing SSL to solve issues.
  • Instant Click – On – similar to the Flying Pages plugin and WP Rocket’s link preloading. When users hover over a link, the page will download in the background so by the time they click it, the page will appear to load instantly (enabling this can consume resources).

LiteSpeed Cache Advanced Settings


  • Use ESI for CartOff – if using ESI, this will turn cart information into ESI blocks so individual elements are treated differently. You can try it, but it may complicate things.
  • Product Update Interval – I prefer the second option since product + category pages are only purged when the stock status changes. Less purging means a faster site, but means users may not see the new stock status + quantity. Too much purging consumes resources.
  • Use Front Page TTL for the Shop Page – On – shop page will use front page TTL setting.
  • Privately Cache CartOff – Johnny recommends leaving it off since “caching non-empty carts are a waste as potential buyers don’t hang around for too long… they can be patient.”

LiteSpeed Cache WooCommerce Settings


5. CDN

  • CDN – On – I recommend using CDN since it was specifically built to work on top of LiteSpeed and is also free. You will need to enter your domain key in the General settings of LiteSpeed Cache before using CDN.
  • User CDN MappingOff – CDN and Cloudflare don’t use CDN mapping.
  • HTML Attribute To Replace – leave as-is since the CDN mapping setting is turned off.
  • Original URLs – leave as-is unless it’s a multisite with different domains + subdomains.
  • Included Directories – just the wp-content and wp-includes directories should be fine.
  • Exclude Path – leave as-is unless you want to exclude specific directories from above.
  • Cloudflare API – only needed if you use Cloudflare’s CDN which you’re likely not using.

LiteSpeed Cache CDN Settings

Setting Up QUIC.Cloud CDN

Ryan from NameHero already made a video on setting up with LiteSpeed, but I listed the steps below as well. There’s a lot of good stuff there and I recommend watching it.

You must follow these initial steps before continuing further: activate CDN, get a domain key, sign up for, and link the domain key to

Visit DashboardLink your domain to and visit the dashboard CDN OverviewEnable CDN in’s CDN Settings CDN SetupUse CNAME method for setting it up Update CNAME will give you a CNAME record
cPanel Zone EditorPaste CNAME record in cPanel → Zone Editor
General SettingsThese steps work best if your website uses www Cache SettingsEnable static cache
Enable QUIC BackendEnable QUIC Backend Domain SummaryWait about 24 hours for DNS to propagate, then make sure CDN is working in


6. Image Optimization

Configure the image optimization settings, then send an optimization request.

  • Auto Request Cron – On – sends a request to optimize newly uploaded images.
  • Auto Pull Cron – On – if the previous setting is turned on, this should be on too.
  • Optimize Original Images – On – see LiteSpeed’s example, but likely turn this on.
  • Remove Original BackupsOff – don’t remove unless you’re happy with the quality.
  • Optimize Losslessly – On – I prefer lossless compression but you can try this yourself.
  • Preserve EXIF/XMP DataOff – removing EXIF data helps reduce your image sizes.
  • Create WebP Versions – On – create WebP images to serve them in next-gen formats.
  • Image WebP Replacement – On – enable this if you have the previous option enabled.
  • WebP Attribute To Replace – leave unless you want to control which images are WebP.
  • WebP For Extra srcset – On – makes sure images in custom code are served as WebP.
  • WordPress Image Quality Control – 82 is good since Lighthouse tests images at 85%.

LiteSpeed Cache Image Optimization Settings


7. Page Optimization

CSS Settings

  • CSS Minify – On – removes unnecessary characters from CSS.
  • CSS CombineOff – don’t combine with HTTP/2 or large CSS files.
  • Generate UCSSOff – only use if CSS combine is turned on. Helps remove unused CSS, but heavy CSS often from themes and plugins. You can try Asset CleanUp or Perfmatters.
  • UCSS InlineOff – again, this setting should only be enabled if combine CSS is turned on.
  • CSS Combine External and InlineOff – only use with combine CSS (prevents breaking).
  • CSS HTTP/2 PushOff – pushing too many resources directly without having to receive requests can actually have a negative impact on load times, so I recommend turning it off.
  • Load CSS AsynchronouslyOff – you’ll likely get FOUC or layout shift issues if this is enabled, but this is something I would definitely test and see how it impacts your speed.
  • CCSS Per URLOff – disable if previous optionis off, especially if using a page builder.
  • Inline CSS Async LibOff – CSS will be render-blocking, but you’ll avoid FOUC issues.
  • Font Display Optimizationdefault. Setting this to Swap can also cause FOUC issues. But if you see “ensure text remains visible during webfont load” in PSI, you can try Swap.

LiteSpeed Cache CSS Settings

JS Settings

  • JS Minify – On – strips unnecessary characters from JavaScript.
  • JS CombineOff – don’t combine with HTTP/2 or large JS files.
  • JS Combine External and InlineOff – only enable if JS combine is enabled.
  • JS HTTP/2 PushOff – pushing too many resources can have a negative impact.
  • Load JS Deferred – needs to be tested. Deferring JavaScript can break things, but if you enable it and it gives you better results, you can set as deferred. For delaying JavaScript, I recommend the Flying Scripts plugin which gives you more control of which JS is delayed.

LiteSpeed Cache JS Settings

HTML Settings

  • HTML MinifyOn – strips unnecessary characters from HTML.
  • DNS Prefetch – prefetch third-party domains loading on your site (if you’re not sure which ones to add, see this list or open up your Lighthouse report or Chrome Dev Tools). Google Fonts, Tag Manager, Analytics, AdSense, and Facebook are some common ones.
  • DNS Prefetch Control – On – leave it on, but nothing to do if you added them manually.
  • HTML Lazy Load Selectors – you can specify a class or ID to lazy load HTML content.
  • Remove Query StringsOff – somewhat outdated and shouldn’t impact load times.
  • Load Google Fonts AsynchronouslyOff – test carefully and view your GTmetrix Waterfall “fonts” tab to see the difference in your font load times. I like to keep it off.
  • Remove Google FontsOff – only use if you’re hosting fonts locally and want to make sure any third-party fonts aren’t being loaded on your website, which they shouldn’t be.
  • Remove WordPress EmojiOn – emojis aren’t good for load times, so turn this on.
  • Remove Noscript TagsOff – some people are still using old browsers. Keeping this ensures better compatibility to make sure your website’s JavaScript is loaded correctly.

LiteSpeed Cache HTML Settings

Media Settings

  • Lazy Load ImagesOff – lazy load is definitely a preference. Some argue it’s terrible for UX, while others want to do it to improve their PageSpeed scores. This is really up to you.
  • Basic Image Placeholder – use an image as the placeholder while your images are loading.
  • Responsive Placeholder – On – it should be on if you’re using a basic image placeholder.
  • Responsive Placeholder SVG – specify the SVG to be used as the responsive placeholder.
  • Responsive Placeholder Color – default gray color LiteSpeed Cache uses should be fine.
  • LQIP Cloud GeneratorOff – a lower quality image (which is generated by will be used as the placeholder before the higher quality image is loaded. Test it yourself.
  • LQIP Quality – if the previous setting is enabled, this determines the lower quality image.
  • LQIP Minimum Dimensions – 150×150 pixels is fine. This is only for when LQIP cloud generator is turned on, and LQIP will only be used when images are larger than this size.
  • Generate LQIP In Background – On – LiteSpeed says turning it off slows down page load.
  • Lazy Load Iframes – On – lazy loading videos, maps, and other iframes improves speed.
  • Add Missing Sizes – On – adds missing image dimensions to set explicit widths + heights.
  • Inline Lazy Load Images Library – On – further improves speed when lazy load is enabled.

LiteSpeed Cache Media Settings

Media Excludes

If you have lazy load turned on, these settings exclude images from lazy load which you’ll want to do for all above the fold images (it would be counterintuitive to lazy load these). It’s probably easiest to add these images (i.e. logo, background images, etc) in the “lazy load image excludes” field. You can also use the settings to exclude images by their class name, parent class name, etc.


  • Gravatar Cache – On – great especially if you have lots of comments which include Gravatars, but I recommend using a local avatar plugin to prevent third-party requests.
  • Gravatar Cache CronOn – you want it enabled if the previous setting is enabled.
  • Gravatar Cache TTL – the default setting of 604800 seconds (1 week) should be fine.

LiteSpeed Cache Localization Settings


Most settings are if you want to exclude specific things from being optimized (CSS, JS, URLs, deferred JS, Guest Mode JS, and roles). You usually only need to do this if a specific setting breaks your site. For example, if you minify or combine CSS/JS and it breaks your site, find the problematic file (in your source code), then add them. Same concept for most other settings.


8. Database

In the Manage tab, you probably want to delete everything except post revisions and auto drafts, which are backups of posts that you may need in the future. You can also optimize tables.

DB Optimization Settings

  • Revisions Max Number – I use 10 so I have backups, but doesn’t cause database bloat.
  • Revisions Max Age – 0 makes sense to me (they will never be deleted). Sometimes I don’t update a post for a very long time, so automatically deleting the backups isn’t a good idea.

LiteSpeed Cache Database Optimization Settings


9. Crawler

This crawls your site for pages with expired cache and refreshes them. It consumes resources (a lot of them) which is why it’s controlled at a server level and usually not allowed by most hosts, especially shared hosting (it’s usually only if you manage your own server). So, you usually don’t need to do anything. If you do manage your own server, you’ll want to enable the crawler and see WP Johnny’s instructions (in summary, he recommends enabling the crawler in the General settings, submitting your sitemap in Sitemap settings, then leaving all other settings as default).

LiteSpeed Cache General Crawler Settings


10. Toolbox

Most Toolbox settings are explanatory (purging, import/export, edit .htaccess, reports, debug, logs, beta test, etc). So I’ll just cover the heartbeat settings which control WordPress heartbeat.

You usually want to limit heartbeat because it consumes resources. But, you usually don’t want to disable it in the frontend/editor because you usually need it there for AJAX functions, autosaves, etc. So while you shouldn’t completely disable it in some areas, you can still limit it.


  • Frontend Heartbeat ControlOn – controls heartbeat on the frontend.
  • Frontend Heartbeat TTL – 120 – doubling this will save server resources.
  • Backend Heartbeat Control – On – control heartbeat on the backend.
  • Backend Heartbeat TTL – 0 – you usually don’t need the heartbeat here.
  • Editor HeartbeatOn – controls things such as your autosave frequency.
  • Editor Heartbeat TTL60 – 15 seconds is too frequent, 60 saves resources.

LiteSpeed Cache Heartbeat Settings


Did I Miss Anything?

I’m always looking to improve my tutorials and will listen to any suggestions you have in the comments. Otherwise if you liked my LiteSpeed Cache guide, I would appreciate you sharing it!

If you’re using Divi or Oxygen Builder, here are other people’s recommended settings from Facebook Group. I can’t say I recommend all them, but apparently it worked in their situation.

LiteSpeed Cache Settings DiviLiteSpeed Cache Settings for Divi
LiteSpeed Cache Settings GuideLiteSpeed Cache Settings for Oxygen Builder


About Tom Dupuis

Tom Dupuis 2017Tom Dupuis writes WordPress speed and SEO tutorials out of his apartment in Denver, Colorado. In his spare time, he plays Rocket League and watches murder documentaries. Read his bio to learn 50 random and disturbing things about him.

Keep reading the article at Tom Dupuis. The article was originally written by Tom Dupuis on 2021-10-10 13:50:42.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Your ❤️ Love! Like Us
Scroll to Top