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
litespeed_wiki:cache:lscxf:installation [2016/02/04 17:39]
Michael Alegre [Installation]
litespeed_wiki:cache:lscxf:installation [2019/05/17 14:37] (current)
Kacey Schroeder [Pre-Installation Requirements]
Line 5: Line 5:
  
   * LiteSpeed Web Server Enterprise Edition 5.0.12+.   * LiteSpeed Web Server Enterprise Edition 5.0.12+.
-  * 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 all current licenses as well as the 8-CPU legacy ​license. Can be purchased as an add-on for VPS, Ultra VPS, and 1-CPU legacy ​licenses.)
  
 ===== LiteSpeed Web Server Settings ===== ===== LiteSpeed Web Server Settings =====
  
-==== LSCache ==== +Please refer to the Web Server ​section of the [[https://www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache:​common_installation#​web_server_configuration|LiteSpeed Web Cache Common Installation Guide]].
- +
-  - From the WebAdmin Console, navigate ​to Configuration >> ​Server ​>> Cache and set **Storage Path** under "Cache Storage Settings"​. For example"/tmp/xfcache"​ \\ \\ If the directory does not already exist, it will be created for you. +
-  - Under "Cache Policy"​ set the following: \\ \\ **Enable Public Cache** - No \\ **Check Public Cache** - Yes \\ **Enable Private Cache** - No \\ **Check Private Cache** - No \\ **Ignore Request Cache-Control** - Yes \\ \\ All other settings can be left as "Not Set"\\ \\ {{ :litespeed_wiki:​cache:​lscxf:​lsc-settings-xf.png?​direct 800px |}} +
-  - Perform a Graceful Restart. +
 ===== Installation ===== ===== Installation =====
  
Line 27: Line 22:
  
 LSCXF will be enabled by default with a **Public TTL** of 60 seconds. You can enable/​disable LSCXF from "List Add-ons"​ under "​Add-ons"​ in the Home menu.  ​ LSCXF will be enabled by default with a **Public TTL** of 60 seconds. You can enable/​disable LSCXF from "List Add-ons"​ under "​Add-ons"​ in the Home menu.  ​
 +
 +**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]]**.
  
 ===== Configuration ===== ===== Configuration =====
  
-All configuration options can be found under LiteSpeed Cache >> Settings in the Home menu.+All configuration options ​for the LiteSpeed Cache Plugin for XenForo ​can be found under ''​LiteSpeed Cache >> Settings'' ​in the Home menu. 
 + 
 +You only need to set the ''​Public TTL (seconds)''​ setting in the XenForo plugin and the ''​Storage Path''​ setting in the ''​Configuration > Server > Cache''​ tab of your LiteSpeed Web Server Web Admin Console. All other configuration settings can be left as "Not Set".  
  
 **Public TTL (seconds)** [min value: 60] - Maximum time in seconds before a cached item is considered stale. **Public TTL (seconds)** [min value: 60] - Maximum time in seconds before a cached item is considered stale.
  
 ===== Customization ===== ===== Customization =====
 +
 +==== Enabling LSCache For Certain Sites Only  ====
 +If you are a shared hosting provider running LiteSpeed Web Server, there is a good chance that you host more than just WordPress sites. In these cases you would want to enable caching through LSCache only for compatible sites like WordPress and XenForo.
 +
 +You can do this by setting **Check Public Cache** to "​No"​ at the server level (''​Configuration > Server > Cache > Cache Policy''​ in the LiteSpeed Web Server Web Admin), and then modifying the sites .htaccess file to include the following:
 +<​code>​
 +<​IfModule LiteSpeed>​
 +CacheLookup public on
 +</​IfModule>​
 +</​code>​
 +
 +This will turn on CacheLookup for only this site, enabling you to selectively enable LSCache. ​
  
 ==== More Accurate Guest Count ==== ==== More Accurate Guest Count ====
  
-Because pages are being served from cache, the members ​count portion of a page will likely appear slightly ​off for non-logged in users until the currently cached page expires and a fresh copy of the page is requested. Likewise, when non-logged in users visit your site and are only served pages from cache, they never hit the backend and as such are not added to the guest count. This can cause the recorded guest number to be very different than the actual number of guests visiting your site. In this case you can use Google'​s Real-Time stats to see the actual number.+Because pages are being served from cache, the member ​count portion of your pages will likely appear slightly ​inaccurate ​for non-logged in users until the currently cached page expires and a fresh copy of the page is requested. Likewise, when non-logged in users visit your site and are only served pages from cache, they never hit the backend and as such are not added to the guest count. This can cause the recorded guest number to be very different than the actual number of guests visiting your site. In this case you can use Google'​s Real-Time stats to see the actual number.
  
 While serving guests only from cache can increase site performance,​ you may prefer to have this number accurately displayed on your site instead. This can be accomplished using a rewrite rule to force a guest to hit the backend the first time they visit your site. While serving guests only from cache can increase site performance,​ you may prefer to have this number accurately displayed on your site instead. This can be accomplished using a rewrite rule to force a guest to hit the backend the first time they visit your site.
Line 46: Line 58:
   RewriteCond %{HTTP_COOKIE} !xf_session [NC]   RewriteCond %{HTTP_COOKIE} !xf_session [NC]
   RewriteRule (.*)?$ - [E=Cache-Control:​no-cache]   RewriteRule (.*)?$ - [E=Cache-Control:​no-cache]
 +  ​
 +**Note:** "​xf_session"​ is the default session cookie for XenForo. If you have set a customized cookie prefix you will need to replace "​xf"​ with your custom prefix. For example: "​customprefix_session"​.
  
 +You can determine the name of your session cookie by right clicking on a page and using your browser'​s inspect tool. Once the tool is open, click on the network tab and refresh the page. You should now be able to click on the served 200 page and view what cookies are currently set.
 ===== Testing ===== ===== Testing =====
  
-You can check if a page is being served from LSCXF by using your browser'​s developer ​tool to check the response header for the HTML file. This can usually be done by right clicking on the page and selecting some form of “Inspect”. Then click on the “Network” tab in the inspector and reload ​the page. If you see “X-LiteSpeed-Cache:​ hit” in the response header for the HTML file(usually listed first), then the page is being served by LSCXF. ​+You can check if a page is being served from LSCXF by using your browser'​s developer ​tools to check the response header for the HTML file. This can usually be done by right clicking on the page and selecting some form of “Inspect”. Then clicking ​on the “Network” tab in the inspector and reloading ​the page. If you see “X-LiteSpeed-Cache:​ hit” in the response header for the HTML file (usually listed first), then the page is being served by LSCXF. ​
  
 ===== XenForo Debug Mode ===== ===== XenForo Debug Mode =====
  
-To enable debug mode in XenForo , add the following to "​config.php"​ under XenForo'​s "​library"​ directory:+To enable debug mode in XenForo, add the following ​lines to your "​config.php" ​file under XenForo'​s "​library"​ directory:
  
-<​code>​$config['​debug'​] = true;</​code>​ \\ **Note:​** ​It is not recommended ​to enable debug mode on a production site as it will increase resource utilization.+<​code>​$config['​debug'​] = true;</​code>​ \\ **Note:​** ​Enabling debug mode is not recommended on a production site as it will increase resource utilization.
  
 If you would like to enable debug mode only for certain IPs, you can instead add the following: If you would like to enable debug mode only for certain IPs, you can instead add the following:
Line 62: Line 76:
 <​code>​if($_SERVER['​REMOTE_ADDR'​] == '​127.0.0.1'​){$config['​debug'​] = true;​}</​code>​ <​code>​if($_SERVER['​REMOTE_ADDR'​] == '​127.0.0.1'​){$config['​debug'​] = true;​}</​code>​
  
-Where you can replace ​127.0.0.1 with the desired IP Address.+Replacing ​127.0.0.1 with the desired IP Address.
  • Admin
  • Last modified: 2016/02/04 17:39
  • by Michael Alegre