- OpenLiteSpeed Web Server 1.4.19+ installed
- Drupal 8 installed
- Virtual Host set up
- Listener set up
- Cache set up
Installing LSCache module for Drupal on OpenLiteSpeed
Download the module to your local computer via this GitHub link.
Now, go to your Drupal Installation, login to your admin account, go to Extend in the Manage section. Click on Install Module on that page and upload the Drupal module which you just downloaded. The module will now be installed and you can enable it to have the effects of LiteSpeed Cache instantly!
Change Rewrite Rules
After enabling the LiteSpeed Cache plugin, we need to add some rewrite rules so it will work. To change rewrite rules, go to OpenLiteSpeed Webadmin -> Virtual hosts, click on the name of your Virtual Host, go to the Rewrite tab and modify the following settings:
- Enable Rewrite: Yes
- Rewrite Rules:
- In the .htaccess file put:
<IfModule LiteSpeed> CacheLookup on </IfModule>
LiteSpeed Cache Plugin Configuration Options
After installing the LSCache module, your site will be ready to serve the cached (static) content. However, inside the module settings, there are a few options which can be configured according to your needs.
From here, you can clear cache for your website. (Note: the Clear Cache option will clear the cache only for your Drupal installation but the Clear All option will delete the cache for the entire domain which may consist of other applications running on the same domain such as WordPress/Joomla).
Other options can be customized here like Max age and Max age private, which defines for how long the pages of your website would be served from public cache and private cache, respectively. Once a page has been cached for the max time, it will be purged from cache. It will be re-cached with the next visitor request.
If you are in a development environment, you can keep the Debug option on. If your site is ready for production purposes, turn of Debug so it stops emitting extra debugging headers for your Drupal website.
OpenLiteSpeed web server doesn’t support ESI but there’s no harm in keeping the ESI option turned on.