On this page
Joomla & LiteSpeed Cache
Use .htaccess rewrite rules to enable LiteSpeed Cache for your Joomla site and improve page load performance.
LiteSpeed Cache (LSCache) is a server-level page caching solution built into LiteSpeed Web Server. When used with Joomla, it can deliver significant performance gains with minimal configuration. The rules below let you control caching behaviour directly via your .htaccess file.
Where to add the rules
Open the .htaccess file in the document root of your Joomla site and add the rules immediately before this line:
## Begin - Joomla! core SEF Section.
The rewrite rules
########## Begin - LiteSpeed Cache
<IfModule LiteSpeed>
RewriteEngine On
CacheDisable public /
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_HOST} ^domain.com [NC] [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteCond %{ORG_REQ_URI} !/administrator
RewriteRule .* - [E=Cache-Control:max-age=3600]
</IfModule>
########## End - LiteSpeed Cache
Notes
- Replace
domain.comandwww.domain.comwith your actual domain name. - The cache TTL is set to 1 hour (3600 seconds). To change it, update the
max-agevalue in theRewriteRuleline - for example,max-age=86400for 24 hours. - The
/administratorcondition ensures the Joomla admin area is never cached.
If you are running a newer version of Joomla, check whether a dedicated LiteSpeed Cache plugin is available for your version, as it may offer more granular cache management than these rewrite rules alone.
Was this helpful?
Your feedback helps us find gaps in the docs.
Thanks for the feedback!
Related articles
LiteSpeed Cache
What is LiteSpeed Cache?
LiteSpeed Cache is a high-performance, server-level page cache built directly into LiteSpe...
LiteSpeed Cache
How to enable LiteSpeed Cache in cPanel
Enable LiteSpeed Cache in cPanel to start serving faster, dynamically cached pages on your...
LiteSpeed Cache
Verify if LiteSpeed Cache is working
Check whether LiteSpeed Cache is active by inspecting the response headers returned by you...
LiteSpeed Cache
Public cache vs. private cache
Understand when LiteSpeed Cache should use a public cache, a private cache, or no cache at...
Still need a hand?
Real people, around the clock - start a chat or open a ticket and we'll help you put it right.