Extension:LiteSpeedCache

The LiteSpeedCache extension is designed for MediaWiki sites running on a LiteSpeed webserver. Enable its LSCache feature to speed up page loading, reduce response time, and tremendously reduce server load.

The LiteSpeedCache extension was originally written by LiteSpeed Technologies. It is released under the GNU General Public Licence (GPL).

Code and download
You can download the Site Settings code, in .zip format, here.

You can also download the code directly via Git from the LiteSpeedTech source code repository. From a command line, you can call the following: To view the code online, including version history for each file, go here.

Installation
Modify .htaccess file in MediaWiki site root directory, adding the following directives:

 CacheLookup on   

Copy the LiteSpeedCache directory into the extensions folder of your MediaWiki installation. Then, add the following lines to your `LocalSettings.php` file (near the end):

wfLoadExtension( 'LiteSpeedCache' );

After installation, You can navigate to **Special:Version** on your wiki to verify that the extension is successfully installed.

To find a link to the LiteSpeedCache plugin, navigate to **Special:SpecialPages** on your wiki, and look under the **Data and Tools** category.

Settings
From the MediaWiki administrator panel navigate to:

Special pages → LiteSpeed Cache

Edit that page to enable public cache:

LiteSpeed public Cache Enabled - check this and Save the page

Verify Cache Setup
If a resource is served from LSWS cache, the server response header contains  'X-LiteSpeed-Cache: Hit'.

Load the MediaWiki site Main Page: GET /wiki/index.php/Main_Page HTTP/1.1 Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding	gzip, deflate, br Accept-Language	en-US,en;q=0.5 cache-control	public, max-age=2592000 server	LiteSpeed vary	Accept-Encoding, Cookie x-litespeed-cache	hit