LiteSpeed Cache: How to Clear and Manage Your Cache
In this article
To clear the LiteSpeed cache, navigate to the LiteSpeed Cache icon in your WordPress admin top bar and select "Purge All" to empty the entire cache, or "Purge All - LSCache" for a deeper reset. Alternatively, you can access the LiteSpeed Cache plugin menu under "Toolbox" and click the "Purge All" button to ensure all cached versions of your pages are deleted.
Understanding How LiteSpeed Caching Works
LiteSpeed Cache (LSCache) is a server-level cache, which distinguishes it from many other WordPress caching plugins that operate at the application level. When a visitor requests a page, LiteSpeed creates a static HTML version of that page and stores it on the server. Subsequent visitors are served this static file instead of forcing the server to process PHP and query the database for every single request.
While this drastically improves page load speeds and reduces server load, it creates a synchronization problem: when you update a post, change a CSS file, or modify a widget, the server continues to serve the old "cached" version of the page to your visitors. This is why "purging" or clearing the cache is necessary to force the server to generate a fresh version of the content.
Methods for Clearing the LiteSpeed Cache
Depending on the scale of the changes you have made to your site, you may need different levels of purging. Using the wrong method can either leave old content visible or unnecessarily slow down your site by deleting cache that didn't need to be touched.
- Purge All: This is the nuclear option. It clears every single cached page, image, and CSS/JS optimization file across the entire website. Use this after major theme updates, plugin updates, or global CSS changes.
- Purge All - LSCache: This specifically targets the LiteSpeed server-level cache. It is often used when a standard "Purge All" doesn't seem to reflect changes on the live site.
- Purge Page: If you have only edited one specific blog post or page, you can purge just that URL. In the WordPress editor, LiteSpeed often provides a "Purge" button in the sidebar, or you can use the top admin bar while viewing that specific page on the frontend.
- Purge Front Page: A quick shortcut to refresh only the homepage, which is typically the most visited and most heavily cached page on a site.
- Purge CSS/JS: If you have modified your stylesheets or scripts but the layout looks "broken" or outdated, purging the combined and minified CSS/JS files is required.
When Should You Manually Clear the Cache?
In an ideal setup, LiteSpeed Cache handles most purging automatically via "Purge Rules." However, there are specific scenarios where manual intervention is required to ensure site integrity:
- CSS/Layout Changes: When you edit a child theme's style.css or use a page builder to change colors and fonts, the combined CSS file remains cached.
- Plugin Configuration: After changing settings in a plugin that affects the frontend (such as a contact form or a slider), the cached HTML may still show the old version of the plugin's output.
- Database Updates: If you use a search-and-replace tool to change URLs or site-wide text, the server won't know the database has changed until the cache is purged.
- Critical Bug Fixes: When deploying a hotfix for a visual glitch, purging ensures all users see the fix immediately.
Common Problems and Troubleshooting
A frequent point of confusion is when a user clicks "Purge All" but still sees the old version of their website. This is rarely a failure of LiteSpeed Cache itself, but rather a conflict with other layers of caching.
Browser Caching: Your web browser (Chrome, Firefox, Safari) stores its own local copy of the site. Even if the server cache is clear, your browser may be serving a local version. Try opening your site in an Incognito/Private window to verify if the server cache was actually cleared.
CDN Caching: If you use a Content Delivery Network like Cloudflare or QUIC.cloud, the content is cached on edge servers around the world. You must purge the CDN cache in addition to the LiteSpeed cache, or configure the LiteSpeed plugin to automatically trigger a CDN purge when you click "Purge All."
Object Caching: If you have Redis or Memcached enabled, the site is caching database queries. While LiteSpeed handles much of this, sometimes a separate object cache purge is needed if dynamic data (like a shopping cart or user profile) isn't updating.
LiteSpeed Cache vs. Application Caching
To understand why clearing LiteSpeed cache feels different from other plugins, it helps to compare the architecture. Standard plugins like WP Rocket or W3 Total Cache often create static files within the wp-content/cache folder. LiteSpeed, however, communicates directly with the LiteSpeed Web Server software.
The primary advantage is speed; the server handles the cache before WordPress even "wakes up." The trade-off is that if the communication between the WordPress plugin and the server is interrupted, the "Purge" command may not reach the server. This is why checking the "LiteSpeed Server" status in the plugin settings is crucial for ensuring the cache is actually functioning and clearable.
Frequently Asked Questions
Will clearing the cache slow down my website?
Temporarily, yes. When you purge the cache, the server must regenerate the HTML for every page the first time a visitor requests it. This is known as a "cache miss." Once the page is visited once, it is cached again and returns to full speed.
Do I need to clear the cache every time I save a post?
No. LiteSpeed Cache is designed to automatically purge the specific page and the homepage whenever a post is updated or published. You only need to manually purge if you notice the changes aren't appearing.
What is the difference between Purge All and Purge All - LSCache?
"Purge All" generally handles the plugin's internal logic and common cache files. "Purge All - LSCache" sends a more direct command to the LiteSpeed server to wipe all cached objects associated with the site, acting as a more thorough reset.
Why is my site still showing old content after purging?
This is usually caused by browser caching or a secondary cache layer like Cloudflare. Clear your browser cache or check your CDN settings to ensure the edge servers are also refreshed.
Can I schedule the cache to clear automatically?
Yes, LiteSpeed Cache allows you to set a "TTL" (Time to Live). This is a timer that tells the server to automatically expire and refresh the cache after a certain number of seconds, regardless of whether a post was updated.