This is an old revision of the document!
LiteSpeed Cache for Drupal 8
NOTE: This plugin is only for Drupal 8. If you are running an earlier version of Drupal, you will need to use LSCache via rewrite rules.
Drupal 8 is significantly changed from Drupal 7. The developers switched from procedural programming to object-oriented programming. Drupal 8 has a built-in page cache (for static content) and a dynamic page cache for logged in users. The latter basically works as a reverse proxy written in PHP. The built-in proxy is good if you have no other options, however, with the LiteSpeed Cache plugin you will see a great improvement in performance for your Drupal 8 site.
Visit our website for more information about our cache plugins.
See also: LSCache for Drupal on Github
Prerequisites
This version of LiteSpeed Cache requires Drupal 8.xx or later and LiteSpeed Web Server (LSWS) 5.2.3 or later, PHP 7.1 or higher.
Download
Download the LiteSpeed Cache Module to your local computer from our GitHub repository.
Enable LiteSpeedCache using rewrite rules
<IfModule LiteSpeed> CacheLookup on </IfModule>
Install Plugin
Once you have downloaded the plugin, you can install by visiting http://example.com/admin/modules/install
(where example.com/
is your site's domain).
The above import method requires that you have the Drupal core module Update manager
enabled. Without it, the above link may not work.
Using the Browse button you can upload the plugin you just downloaded and start the installation. Once installed, enable the plugin by visiting http://example.com/drupal/admin/modules
- Use the search box to search for a module.
- Check the checkbox next to
LiteSpeed Cache
. - Click Install.
Configuration
This step is optional. Once the plugin is activated, your cache is already up and running, but on the configuration screen, you can customize a few settings.
Visit http://example.com/admin/config/development/lscache
.
Clear Cache
Clear this site
This option only clears the current Drupal installation. This helps if you have multiple Drupal installations on the same virtual host.
Clear all
This button clears the entire LiteSpeed cache for this virtual host. This includes any other web apps using LSCache (WordPress, XenForo, etc.) on this vhost.
Debug
If turned on, LiteSpeed Cache will emit extra headers for testing while developing or deploying.
Public Cache TTL
Amount of time LiteSpeed Web Server will save pages in the public cache.
Troubleshooting
Installation Errors
500 error
You may experience a 500 error during installation if:
- The PHP version is less than 7.1
- PHP module packages are missing
Check your PHP version. If it's lower than PHP 7.1, installation will fail.
If it's PHP 7.1 and above, there may be some missing PHP modules. Check the server error log.
If you see something like this:
[STDERR] Error: Class 'ZipArchive' not found in /var/www/html/core/lib/Drupal/Core/Archiver/Zip.php on line 30 #0 /var/www/html/core/lib/Drupal/Core/Archiver/ArchiverManager.php(42): Drupal\Core\Archiver\Zip->__construct('/tmp/lscache-dr...')
install the php-pecl-zip
package, and that should fix the problem.