LiteSpeed Cache for Craft CMS¶
PLEASE READ
Development on the 3rd party LSCache Purge plugin for Craft CMS has been discontinued:
Per-URL cache busting is now broken in Craft 3.5 because of changes to how template caching works. You will need to nuke the whole cache on save if you are running 3.5+
This plugin is EOL. Minor patches will be issued, but not major functionality overhauls. PR's gratefully received.
We recommend using LSCache with rewrite rules via these instructions if you are using Craft CMS v3.5 or later.
What is LSCache?¶
LiteSpeed Cache (LSCache) is a built-in, high-performance dynamic content acceleration feature of LiteSpeed server products.
LSCache accelerates dynamic content (not just PHP pages), with features very similar to those in Apache mod_cache
, using an efficient, highly customizable, native implementation within the LiteSpeed server, which greatly reduces page load time and server load.
LSCache eliminates the extra reverse-proxy layer(s) required by add-on cache packages (such as Varnish), providing faster, more efficient handling of static content in addition to its stellar handling of dynamic content.
When used in conjunction with Craft CMS, you can expect significant performance gains with a quick and easy setup. Rewrite rules can be used to customize LSCache's behavior.
With the addition of the 3rd party "Purge Cache" plugin by Scaramanga Agency, cache management is made even more flexible, allowing you to set longer TTLs for your content.
Server-Level Prerequisites¶
Obtain a LiteSpeed Web Server¶
You will either need LiteSpeed-powered hosting, or one of the following LiteSpeed server products in order to use LSCache:
- LiteSpeed Enterprise Web Server:
- LiteSpeed Web ADC
- OpenLiteSpeed
Configure the Server¶
LSCache must be set up at the server level before it can be made available to any sites on the server.
Tip
If you are a site owner and you don't have access to your server's admin functions, chances are your hosting provider has already done this setup for you, or can help you to complete it.
See Configure Cache Root and Cache Policy for instructions
Install, Configure and Use the Plugin¶
Once you've set up your web server and configured the cache root and cache policies, you're ready to install the plugin. The plugin will allow you to configure and manage your LiteSpeed server's cache simply and easily, through your site's own familiar admin interface.
Start with Installation and follow the documentation menu to configure and use the plugin.
Additional Support¶
If you still have a question after reading through the documentation, you have a few options:
- Join the GoLiteSpeed Slack community for real-time discussion
- Visit the LiteSpeed Forums for community support
- Submit a ticket from the client area or by emailing
support@litespeedtech.com
Feedback¶
Do you have some thoughts about our new documentation site? Join our GoLiteSpeed Slack, drop by the #documentation channel, and let us know what you think!