Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:lscwp:installation [2016/09/21 12:51]
Rob Holda [Testing]
litespeed_wiki:cache:lscwp:installation [2020/05/04 13:33]
Shivam Saluja Note
Line 1: Line 1:
 +**Please Note**: This wiki is valid for v2.9.x and below of the LiteSpeed Cache Plugin for WordPress. If you are using v3.0 or above, please see [[https://​docs.litespeedtech.com/​lscache/​lscwp/​overview/​|the new documentation]].
 +
 ====== Installing & Enabling The LSCache Plugin For WordPress ====== ====== Installing & Enabling The LSCache Plugin For WordPress ======
  
 +There are two ways to use LSCWP:
 +  - Without a LiteSpeed server, and with limited functionality (optimization features only, no cache)
 +  - With a LiteSpeed Web Server + LSCache license, and with full functionality (optimization and cache features)
  
-===== Pre-Installation Requirements ​=====+**If you are not currently running a LiteSpeed Web Server with LSCache enabled, but you would like to use the caching features of the WordPress plugin, please contact your hosting provider. Ask them to switch you to LiteSpeed Web Server!** 
 + 
 +===== LSCWP Without LiteSpeed Web Server ===== 
 +  * Simply install and activate the plugin through the WordPress Admin interface. 
 +  * Navigate to **LiteSpeed Cache > Settings** and click ''​Advanced View''​ to see all the tabs. 
 +  * Have fun playing with the options! [[litespeed_wiki:​cache:​lscwp:​configuration|Tab-by-tab instructions are here]], if you need them. 
 + 
 +===== LSCWP With LiteSpeed Web Server ===== 
 + 
 +==== Pre-Installation Requirements ====
  
   * LiteSpeed Web Server Enterprise Edition 5.0.10+.   * 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.)+  * LSCache Module. (Included with a Free Starter, Site Owner, and Web Host license, as well as an 8-CPU legacy ​license. Can be purchased as an add-on for VPS, Ultra VPS, and 1-CPU legacy ​licenses.) 
 +  * Disable other full-page caches plugin if used (such as WP Super Cache, W3 Total Cache, WP Rocket, WP Fastest Cache etc.) 
  
-===== Installation ​=====+==== Installation ====
  
-  - 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_wiki:​cache:​common_installation#​web_server_configuration|LiteSpeed Web Cache Common Installation Guide]]**+  - Configure server-level ​and/or virtual-host-level cache root and cache policy by selecting your setup in the Web Server Configuration section of the [[litespeed_wiki:​cache:​common_installation#​web_server_configuration|LiteSpeed Web Cache Common Installation Guide]]. 
-  - Disable any other page caches as these will interfere with LSCWP.+  - Disable any other page caches as these will interfere with LSCWP.<​sup>​*</​sup>​
   - [[https://​wordpress.org/​plugins/​litespeed-cache/​|Download the LSCWP plugin]] from our WordPress Plugin Directory page.   - [[https://​wordpress.org/​plugins/​litespeed-cache/​|Download the LSCWP plugin]] from our WordPress Plugin Directory page.
-  - Log in to your WordPress Dashboard, navigate to "Plugins", ​and click on "Add New" -> "Upload Plugin"+  - Log in to your WordPress Dashboard, navigate to **Plugins ​> Add New** and click on **Upload Plugin**
-  - Select the LSCWP zip file and click "Install Now"+  - Select the LSCWP zip file and click **Install Now**. Activate the plugin
-  - Enable the plugin by navigating ​to Plugins >> ​LiteSpeed Cache >> Settings and checking the box for **Enable LiteSpeed Cache**.+  - Navigate ​to **LiteSpeed Cache > Settings ​> General** ​and set **Enable LiteSpeed Cache** ​to ''​Enable''​.
  
-**Note:** If you are using any of our other LiteSpeed Cache plugins, please see **[[litespeed_wiki:​cache:​common:​logged-in-cookie-conflicts|Handling Logged-in Cookie Conflicts]]**.+You may also install the plugin directly from the **Plugins > Add New** screen. Replace steps 3-5 above with: 
 +  ​Search for ''​LiteSpeed Cache''​ in the search box. Our plugin should be the first search result to come up. 
 +  ​Press **Install Now**. Activate the plugin.
  
-===== Testing =====+* Please see [[litespeed_wiki:​cache:​lscwp:​customizations:​multi-cache-plugins|this wiki article]] for assistance using multiple optimization plugins at once.
  
-You can check if a page is being served from LSCWP by:  +==== Testing ==== 
-  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 + 
-    - Right click on the page and select some form of “Inspect”,​ then click on the “Network” tab in the inspector.+You can verify ​a page is being served from LSCWP through the following steps:  
 +    Open the developer tools on //non-logged-in browser// and navigate to your siteOpen the **Network** tab.
     - Refresh the page.     - Refresh the page.
-    - 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 ''/''​. +    - Click the first resource (this should be an HTML file and the resource'​s headers ​should ​appear as in the image below). For example, if your page is ''​<​nowiki>​http://example.com/​wordpress/</​nowiki>​'',​ your first resource should either be something like ''​example.com/wordpress/''​ or ''​wordpress/''​.{{:​litespeed_wiki:​cache:​lscwp:​wpcachetest.png?​direct&​900|}} 
-{{:​litespeed_wiki:​cache:​lscwp:​wpcachetest.png?​direct&​900|}}+  - In a different, //logged-in browser//, in your WordPress Dashboard, navigate to **LiteSpeed Cache > Manage** and click the **Purge All** button.  
 +  - Reload the page in the first (non-logged-in) browser and select the same resource again. If you see headings similar to <​code>​ 
 +X-LiteSpeed-Cache:​ miss 
 +X-LiteSpeed-Cache-Control:​public,​max-age=1800 
 +X-LiteSpeed-Tag:​B1_F,​B1_ </​code>​(for example), this means the page had not yet been cached, but that LiteSpeed has now stored it for future use. 
 +  - Reload the page a second time and you should see ''​X-LiteSpeed-Cache:​ hit''​ in the response header. This means the page is being served by the cache and LSCWP is configured correctly.
  
-  - In a different, logged-in browser, navigate to the cache manager and purge your cache.  +**Note:** If your first refresh after purging returns ''​X-LiteSpeed-Cache:​ hit'' ​in the response header, ​this may be because someone else visited ​the page //after// you purged but //before// you refreshed it yourself. Try again from step 4.
-  - Reload the page in the non-logged-in browser and select the same resource again. If you see "​X-LiteSpeed-Cachemiss", "​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.  +
-  - If you reload page a second time and see “X-LiteSpeed-Cache:​ hit” in the response header ​for the HTML filethen 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.+==== Good to Know ====
  
-**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. +Here are a few other things that may may be useful for your installation.
-===== Turning On the WordPress Debug Log =====+
  
-To enable ​the WordPress ​debug log, modify "​wp-config.php"​ under WordPress'​ root directory as follows:+=== Turning On the WordPress ​Debug Log ===
  
-  ​- Set "WP_DEBUG" ​to true. \\  \\ <​code>​define('​WP_DEBUG',​true);</​code>​+To enable the WordPress debug log, modify ''​wp-config.php''​ under WordPress'​ root directory as follows: 
 + 
 +  ​- Set ''​WP_DEBUG'' ​to true. \\  \\ <​code>​define('​WP_DEBUG',​true);</​code>​
   - Add the following: \\ \\ <​code>​define('​WP_DEBUG_LOG',​true);</​code>​   - Add the following: \\ \\ <​code>​define('​WP_DEBUG_LOG',​true);</​code>​
  
-a "debug.log" ​file should now be generated under "wp-content" which will log information whenever WordPress hits the backend. ​+A ''​debug.log'' ​file will be generated under the ''​wp-content''​ directory, and will log information whenever WordPress hits the backend. ​
  
 You can monitor this log during debugging using the following command: You can monitor this log during debugging using the following command:
   tail -f wp-content/​debug.log   tail -f wp-content/​debug.log
   ​   ​
 +
 +=== Multiple LiteSpeed Cache Plugins ===
 +
 +If you are using any of our other LiteSpeed Cache plugins for other web apps (like Magento, PrestaShop, XenForo, etc), or you are running multiple instances of WordPress, please see [[litespeed_wiki:​cache:​common:​logged-in-cookie-conflicts|this article]] for some important information about avoiding conflicts between the different apps' caches.
   ​   ​
 +=== WordPress Lacks Permissions ===
 +
 +If WordPress doesn'​t have access to create tables in your database, please run these SQL queries manually after installation:​
 +
 +<code sql>
 +CREATE TABLE IF NOT EXISTS wp_litespeed_optimizer (
 +id int(11) NOT NULL AUTO_INCREMENT,​
 +hash_name varchar(60) NOT NULL COMMENT “hash.filetype”,​
 +src text NOT NULL COMMENT “full url array set”,
 +dateline int(11) NOT NULL,
 +refer varchar(255) NOT NULL COMMENT “The container page url”,
 +PRIMARY KEY (id),
 +UNIQUE KEY hash_name (hash_name),​
 +KEY dateline (dateline)
 +);</​code>​
 +
 +and
 +
 +<code sql>
 +CREATE TABLE IF NOT EXISTS `wp_litespeed_img_optm` (
 +  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,​
 +  `post_id` bigint(20) unsigned NOT NULL DEFAULT '​0',​
 +  `optm_status` varchar(64) NOT NULL DEFAULT '',​
 +  `src` varchar(1000) NOT NULL DEFAULT '',​
 +  `srcpath_md5` varchar(128) NOT NULL DEFAULT '',​
 +  `src_md5` varchar(128) NOT NULL DEFAULT '',​
 +  `server` varchar(255) NOT NULL DEFAULT '',​
 +  `root_id` int(11) NOT NULL DEFAULT '​0',​
 +  `src_filesize` int(11) NOT NULL DEFAULT '​0',​
 +  `target_filesize` int(11) NOT NULL DEFAULT '​0',​
 +  `target_saved` int(11) NOT NULL DEFAULT '​0',​
 +  `webp_filesize` int(11) NOT NULL DEFAULT '​0',​
 +  `webp_saved` int(11) NOT NULL DEFAULT '​0',​
 +  PRIMARY KEY (`id`),
 +  UNIQUE KEY `post_id_2` (`post_id`,​`srcpath_md5`),​
 +  KEY `post_id` (`post_id`),​
 +  KEY `optm_status` (`optm_status`),​
 +  KEY `root_id` (`root_id`),​
 +  KEY `src_md5` (`src_md5`),​
 +  KEY `srcpath_md5` (`srcpath_md5`)
 +  );</​code>​
  
 +**Note:** If your site uses a table prefix other than ''​wp_'',​ please replace the ''​wp_''​ in ''​wp_litespeed_optimizer''​ with your site's prefix.
  • Admin
  • Last modified: 2020/11/14 15:39
  • by Lisa Clarke