Installing & Enabling The LSCache Plugin For WordPress

Pre-Installation Requirements

  • LiteSpeed Web Server Enterprise Edition 5.0.10+.
  • LSCache Module. (Included with a 2-CPU or higher license. Can be purchased as an add-on for VPS, Ultra VPS, and 1-CPU licenses.)

Installation

  1. Configure server and/or virtual host level cache root and cache policy by selecting your setup in the Web Server Configuration section of the LiteSpeed Web Cache Common Installation Guide.
  2. *Disable any other page caches as these will interfere with LSCWP.
  3. Download the LSCWP plugin from our WordPress Plugin Directory page.
  4. Log in to your WordPress Dashboard, navigate to “Plugins”, and click on “Add New” → “Upload Plugin”.
  5. Select the LSCWP zip file and click “Install Now”.
  6. Enable the plugin by navigating to Plugins » LiteSpeed Cache » Settings and checking the box for Enable LiteSpeed Cache.

Note: If you are using any of our other LiteSpeed Cache plugins, please see Handling Logged-in Cookie Conflicts.

* Please see this wiki article if the other cache plugin is intended for uses other than full page caching.

Testing

You can check if a page is being served from LSCWP by:

  1. Make sure you are not logged-in especially admin log in any tab for your browser. Navigating to your site from a non-logged-in browser and using your browser's developer tools to check the response header for the first file.
  2. Right click on the page and select some form of “Inspect”, then click on the “Network” tab in the inspector.
  3. Refresh the page.
  4. Click the first resource (this should be an HTML file and the inspector should change similarly to the image below). For example, if your page is http://testsubdo.com, your first resource should either be something like testsubdo.com or /.

  1. In a different, logged-in browser, navigate to the cache manager and purge your cache.
  2. Reload the page in the non-logged-in browser and select the same resource again. If you see “X-LiteSpeed-Cache: miss”, “X-LiteSpeed-Cache-Control:public,max-age=1800”, and “X-LiteSpeed-Tag:F,B.1” (as an example), this will store the page in the cache.
  3. If you reload page a second time and see “X-LiteSpeed-Cache: hit” in the response header for the HTML file, then the page is being served by the cache and LSCWP is configured correctly.

Currently, this plugin only provides caching for non-logged-in users and further development is in progress.

Note: If your first refresh after purging returns “X-LiteSpeed-Cache: hit“ in the response header, this may be because someone visited the page after you purged but before you refreshed it yourself.

Turning On the WordPress Debug Log

To enable the WordPress debug log, modify “wp-config.php” under WordPress' root directory as follows:

  1. Set “WP_DEBUG” to true.

    define('WP_DEBUG',true);
  2. Add the following:

    define('WP_DEBUG_LOG',true);

a “debug.log” file should now be generated under “wp-content” which will log information whenever WordPress hits the backend.

You can monitor this log during debugging using the following command:

tail -f wp-content/debug.log
 
litespeed_wiki/cache/lscwp/installation.txt · Last modified: 2017/03/31 21:21 by Michael Alegre