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:lscdrupal [2018/02/01 21:41]
Lisa Clarke [LiteSpeed Cache for Drupal 8]
litespeed_wiki:cache:lscdrupal [2018/12/11 15:42]
Lisa Clarke [Verify/Test if LiteSpeed cache is working or not] Proofreading
Line 1: Line 1:
 ====== LiteSpeed Cache for Drupal 8 ====== ====== LiteSpeed Cache for Drupal 8 ======
 +
 +**NOTE: This plugin is only for Drupal 8. If you are running an earlier version of Drupal, you will need to use [[litespeed_wiki:​cache:​no-plugin-drupal|LSCache via rewrite rules]].**
  
 Drupal 8 is significantly changed from Drupal 7. The developers switched from procedural programming to object-oriented programming. Drupal 8 has a built-in page cache (for static content) and a dynamic page cache for logged in users. The latter basically works as a reverse proxy written in PHP. The built-in proxy is good if you have no other options, however, with the LiteSpeed Cache plugin you will see a great improvement in performance for your Drupal 8 site. Drupal 8 is significantly changed from Drupal 7. The developers switched from procedural programming to object-oriented programming. Drupal 8 has a built-in page cache (for static content) and a dynamic page cache for logged in users. The latter basically works as a reverse proxy written in PHP. The built-in proxy is good if you have no other options, however, with the LiteSpeed Cache plugin you will see a great improvement in performance for your Drupal 8 site.
  
 Visit [[https://​www.litespeedtech.com/​products/​cache-plugins|our website]] for more information about our cache plugins. Visit [[https://​www.litespeedtech.com/​products/​cache-plugins|our website]] for more information about our cache plugins.
 +
 +See also: [[https://​github.com/​litespeedtech/​lscache-drupal|LSCache for Drupal on Github]]
  
 =====Prerequisites===== =====Prerequisites=====
-This version of LiteSpeed Cache requires **Drupal 8.xx** or later and **LiteSpeed Web Server (LSWS) 5.2.3** or later.+This version of LiteSpeed Cache requires **Drupal 8.xx** or later and **LiteSpeed Web Server (LSWS) 5.2.3** or later, **PHP 7.1** or higher.
  
 =====Download===== =====Download=====
-Download the LiteSpeed Cache Module to your local computer from [[https://​github.com/​litespeedtech/​lscache_drupal/​archive/​master.zip|our GitHub repository]].+Download the LiteSpeed Cache Module to your local computer from [[https://​github.com/​litespeedtech/​lscache-drupal/​archive/​master.zip|our GitHub repository]].
  
-=====Enable LiteSpeedCache ​using rewrite rules=====+=====Enable LiteSpeedCache ​lookup by placing the following to .htaccess at Doc_Root ​===== 
 + 
 +Place the following into .htaccess:
  
 <​code>​ <​code>​
Line 21: Line 27:
 =====Install Plugin===== =====Install Plugin=====
 Once you have downloaded the plugin, you can install by visiting ''<​nowiki>​http://​example.com/​admin/​modules/​install</​nowiki>''​ (where ''​example.com/''​ is your site's domain). Once you have downloaded the plugin, you can install by visiting ''<​nowiki>​http://​example.com/​admin/​modules/​install</​nowiki>''​ (where ''​example.com/''​ is your site's domain).
 +
 +The above import method requires that you have the Drupal core module ''​Update manager''​ enabled. Without it, the above link may not work.
  
 Using the **Browse** button you can upload the plugin you just downloaded and start the installation. Once installed, enable the plugin by visiting ''<​nowiki>​http://​example.com/​drupal/​admin/​modules</​nowiki>''​ Using the **Browse** button you can upload the plugin you just downloaded and start the installation. Once installed, enable the plugin by visiting ''<​nowiki>​http://​example.com/​drupal/​admin/​modules</​nowiki>''​
Line 29: Line 37:
   * Check the checkbox next to ''​LiteSpeed Cache''​.   * Check the checkbox next to ''​LiteSpeed Cache''​.
   * Click **Install**.   * Click **Install**.
 +
 +===== Verify LiteSpeed Cache is Working ​ =====
 +Look for the response header ''​X-LiteSpeed-Cache:​ hit''​ in the browser developer tools to verify a page is being served from LiteSpeed Cache. Here's how:
 +
 +  - Open the Chrome/​Firefox developer tools on a non-logged-in browser and navigate to your site. Open the **Network** tab.
 +  - Refresh the page.
 +  - Click the first resource (this should be an HTML file). The resource'​s headers should appear, and ''​X-LiteSpeed-Cache:​ hit''​ should be among them.
 +  - If you see ''​X-LiteSpeed-Cache:​ miss''​ instead, refresh the page and check the header again.
 +  - If you continue to not see ''​X-LiteSpeed-Cache:​ hit'',​ it means LiteSpeed is not working or is not enabled properly. Please go back to the beginning and make sure you have carried out each step properly. ​
  
 =====Configuration===== =====Configuration=====
Line 36: Line 53:
 Visit ''<​nowiki>​http://​example.com/​admin/​config/​development/​lscache</​nowiki>''​. Visit ''<​nowiki>​http://​example.com/​admin/​config/​development/​lscache</​nowiki>''​.
  
-{{:​litespeed_wiki:​cache:​lscdrupal-configure.png?​800}}+{{ :​litespeed_wiki:​cache:​configure-lscache.png?​800 ​|}}
  
 ====Clear Cache==== ====Clear Cache====
Line 52: Line 69:
 If turned on, LiteSpeed Cache will emit extra headers for testing while developing or deploying. If turned on, LiteSpeed Cache will emit extra headers for testing while developing or deploying.
  
-====ESI==== 
  
-This setting allows you to use Edge Side Includes with LiteSpeed Web Server Enterprise edition. (OpenLiteSpeed doesn'​t support ESI, although it does no harm to keep it turned on.) 
  
-====Max Age====+====Public Cache TTL====
  
 Amount of time LiteSpeed Web Server will save pages in the public cache. Amount of time LiteSpeed Web Server will save pages in the public cache.
  
-====Max Age Private==== 
  
-Amount of time LiteSpeed Web Server ​will save pages in the private cache.+===== Troubleshooting ===== 
 + 
 +==== Installation Errors ==== 
 + 
 +=== 500 error === 
 +  
 +You may experience a 500 error during installation if: 
 +  * The PHP version is less than 7.1 
 +  * PHP module packages are missing 
 + 
 +Check your PHP version. If it's lower than PHP 7.1, installation ​will fail. 
 + 
 +If it's PHP 7.1 and above, there may be some missing PHP modules. Check the server error log. 
 + 
 +If you see something like this: 
 + 
 +<​code>​ 
 +[STDERR] Error: Class '​ZipArchive'​ not found in /​var/​www/​html/​core/​lib/​Drupal/​Core/​Archiver/​Zip.php on line 30 #0 /​var/​www/​html/​core/​lib/​Drupal/​Core/​Archiver/​ArchiverManager.php(42):​ Drupal\Core\Archiver\Zip->​__construct('/​tmp/​lscache-dr...') 
 +</​code>​
  
 +install the ''​php-pecl-zip''​ package, and that should fix the problem.
  • Admin
  • Last modified: 2020/08/19 18:29
  • by Lisa Clarke