How to Install & Enable LsCache Plugin for MediaWiki
- Download the LsCache plugin from LiteSpeed's Github repository.
- Insert the following line into .htaccess file if it doesn't exist.
<IfModule LiteSpeed>
CacheLookup on
</IfModule>
- Move the LiteSpeedCache directory to /extensions in the MediaWiki directory.
You can do this by using a File Manager or Filezilla FTP (as shown below).
- Edit LocalSettings.php in the MediaWiki root directory, and add the following near the end:
wfLoadExtension( 'LiteSpeedCache' );
- Log in to MediaWiki and from the administrator panel, navigate to Special pages > Data and Tools > LiteSpeed Cache'.
- Click on Edit to edit the page to enable public cache:
- Set the following to be checked and save the page by pressing Save Cache Setting
LiteSpeedCache Enabled : Enabled
Public Cache TTL (seconds) : 864020
Private Cache Enabled (for logged-in users) : Enabled
Private Cache TTL (seconds) : 7200
- Once you have saved the settings successfully, it will show you **"LiteSpeed Cache Settings Saved!" **
That's the end of this tutorial!
Verify Cache Setup (To Determine Whether LsCache is Working Properly)
- Visit the main page of your MediaWiki website.
Using Google Chrome as example, press the shortcut button CTRL+SHIFT+I to open up the developer tools tab or by using the manual way as shown below
- Click on the Network section on the developer tools tab. Remember to load your MediaWiki website URL by pressing the F5 button.
- Once loading is done, you should see the following information which indicates LsCache plugin is running successfully at the background.
X-LiteSpeed-Cache: hit,private
Updated on: 27/12/2018
Thank you!