Configuring Litespeed Cache
This guide provides the optimal LiteSpeed Cache settings to enhance your website's performance. While these settings are highly recommended, they may not work perfectly with every website due to varying configurations. It's important to test changes thoroughly and ensure compatibility.
Before making any adjustments, take a backup of your current settings to safeguard against any potential issues.
1. General Settings:
- Automatically Upgrade: On
Enables/Disables automatic plugin updates. - Domain Key: Request and link to QUIC.cloud
Allows your site to connect with QUIC.cloud services for optimizations. - Guest Mode: Depends
Speeds up the first-time visitor’s page load, but uses extra server resources. Recommended for sites with heavy traffic. - Guest Optimization: Depends
Works only if Guest Mode is enabled. Optimizes images/pages for faster load times. - Server IP: Paste your server’s IP
Enables LiteSpeed to identify your server’s IP for better functionality. - Notifications: On
Receive alerts for new releases and important notices from LiteSpeed.
2. Cache Settings:
- Enable Cache: On
Activates the cache to speed up site loading by storing static versions of pages. - Cache Logged-in Users: Off
Use only if you have logged-in users who need personalized cache, e.g., membership sites. - Cache Commenters: Off
Creates separate cache for users leaving comments, using extra resources. - Cache Rest API: On
Caches API calls commonly used by WordPress themes and plugins. - Cache Login Page: On
Caches the login page to reduce server load. Keep enabled unless there’s a specific need to disable. - Cache favicon.ico: On
Caches the favicon (browser tab icon) to improve speed. - Cache PHP Resources: On
Caches static PHP-generated files like CSS/JS for faster delivery. - Cache Mobile: Depends
Enable only if using Guest Mode or mobile-specific settings like AMP. - Cache URIs: Not necessary
No need for most sites unless specific URIs require caching. - Drop Query String: Use default
Prevents query strings (common in marketing URLs) from affecting cache handling.
3. TTL (Time to Live):
- Cache TTL: Default is fine
Determines how long cache remains before refreshing. Adjust only if frequently updating your site.
4. Purge Settings:
- Purge All On Upgrade: On
Purges cache after WordPress core/plugins/themes are updated to avoid displaying outdated content. - Auto Purge Rules For Publish/Update: Default
Auto purges related content when publishing or updating posts/pages. - Serve Stale: Off
Serves the latest stale cache when a fresh version isn’t available. Disabled to conserve resources. - Scheduled Purge URLs: Optional
Set specific URLs to purge on schedule, useful during low traffic times. - Purge All Hooks: Default
Keeps default purging behavior during WordPress hooks/events. Only add custom purges if necessary.
5. Excludes:
No changes required for most sites. Only exclude content from the cache if necessary.
6. ESI (Edge Side Includes):
- Enable ESI: Off
Allows dynamic elements to be cached differently from static content. Keep off unless you have advanced needs.
7. Object Cache Settings:
- Object Cache: On
Caches database queries to improve site performance, especially for WooCommerce or dynamic sites. - Method: Redis
Redis is faster than Memcached. (Business packages only) - Host/Port: Set according to your cPanel credentials
Enter Redis details provided by cPanel - Persistent Connection: On
Keeps a live connection to speed up caching processes. - Cache WP-Admin: On
Speeds up the WordPress admin dashboard by caching it. - Store Transients: Off
No need to store transients when caching WP-Admin is enabled.
8. Browser Cache:
- Browser Cache: On
Tells browsers to store certain files (like images, CSS) locally to improve speed. - Browser Cache TTL: 31557600
Sets browser cache to one year as recommended by Google for static assets. Adjust for WooCommerce or dynamic sites.
9. Advanced Settings:
- Login Cookie: Leave as-is
Only relevant if managing multiple WordPress sites with distinct logins. - Improve HTTP/HTTPS Compatibility: Off
Only use if you’re running both HTTP and HTTPS versions of your site and encountering issues. - Instant Click: On
Preloads pages when users hover over a link, reducing load time.
10. CDN Settings:
- QUIC.cloud CDN: On
Utilize QUIC.cloud for better performance, especially if using their full plan. - Use CDN Mapping: Off
Turn off unless using a CDN with a custom URL (e.g., BunnyCDN).
11. Image Optimization:
- Auto Request Cron: On
Automatically optimizes newly uploaded images. - Optimize Original Images: On
Ensures your original images are optimized for faster delivery. - Create WebP Versions: On
Generates WebP images for faster load times using next-gen formats.
12. Page Optimization (CSS/JS/HTML):
- CSS Minify: On
Minimizes CSS files to reduce size. - CSS Combine: Test
Combines CSS files but may cause issues with large files. Test for your site. - JS Minify: On
Minimizes JavaScript files. - JS Combine: Off
Not recommended unless combining JS is necessary for your site. - HTML Minify: On
Removes unnecessary characters from HTML to improve loading speed.
13. Media Settings:
- Lazy Load Images: On
Loads images only when visible, improving speed. - Basic Image Placeholder: On
Displays a placeholder while images are loading. - LQIP Cloud Generator: On
Generates low-quality images to load first, improving page speed. - Lazy Load Iframes: On
Improves load time for embedded iframes (videos, maps).
14. Viewport Image Settings:
- Viewport Images: On
Excludes above-the-fold images from lazy loading to improve Largest Contentful Paint (LCP).
15. Localization Settings:
- Gravatar Cache: On
Speeds up Gravatar loading by caching them locally. - Localize Resources: On
Hosts external JavaScript files locally for faster loading.
16. Tuning:
Tuning allows exclusion of specific files from optimization if they cause issues. Add CSS/JS/URLs here to troubleshoot.
17. Database Optimization:
- Revisions Max Number: 10
Keeps up to 10 revisions of posts to minimize database bloat. - Revisions Max Age: 0
Keeps revisions indefinitely. You can adjust this to limit revision retention.
18. Crawler Settings:
Crawls and refreshes expired cache automatically, but may consume resources.
19. Heartbeat Control:
- Frontend/Backend Heartbeat Control: On
Controls the WordPress heartbeat to reduce server resource usage. - Editor Heartbeat TTL: 120
Adjusts autosave interval to reduce resource usage.
20. Perfmatters Integration:
- Disable unnecessary plugins/CSS/JS
Use Perfmatters to disable assets on pages where they are not needed, improving performance.