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:customizations:multi-cache-plugins [2017/08/02 15:50]
Lisa Clarke [A Note about ExpiresDefault]
litespeed_wiki:cache:lscwp:customizations:multi-cache-plugins [2020/05/04 13:35]
Shivam Saluja Note
Line 1: Line 1:
-===== Using Multiple ​Cache Plugins ======+**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]].
  
-Not all cache plugins are good candidates to pair with LiteSpeed. Our plugin is a full-page cache. You can get more details on that here, but essentially what that means is that LSCache stores copies of fully-assembled pages. **It’s strongly recommended that you only use one full-page cache.** In order for the other plugin to be a good fit with LSCache, it must either:+====== Using Multiple Optimization Plugins =======
  
-  ​not include ​a full-page cache at all, or +LiteSpeed Cache for WordPress has many optimization features in addition to our signature full-page cache, and as such, you probably don't need any other similar plugins. If you still want to use one of the other WordPress optimization plugins for whatever reason, that shouldn'​t be problem, as long as you don't try to use the same features in both. 
-  - include ​a full-page cache that can be disabled.+ 
 +For example, if you are using our full-page cache and our CDN support, then you will need to make sure that page cache and CDN support are disabled in whatever other plugin you use. Similarly, if you are using a minification function (for example) in another plugin, you will need to keep minification disabled in our plugin. 
 + 
 +Duplicating functionality ​at best bogs down your server, and at worst breaks your site. So don't do it! 
 + 
 +[[https://​blog.litespeedtech.com/​2017/​08/​02/​wpw-using-multiple-cache-plugins/​|To learn more about this, see our blog.]] 
 + 
 +===== Are these plugins compatible? ===== 
 +Not all cache plugins are good candidates to pair with LiteSpeed. In order to avoid duplicating our functionsa plugin must either: 
 + 
 +  - not include ​the same cache and optimization functions as LiteSpeed Cache at all, or 
 +  ​include ​cache and optimization functions ​that can be disabled ​one-by-one.
  
 ===== Setting up the other plugin ===== ===== Setting up the other plugin =====
 Before you install and activate LiteSpeed Cache, you should first get the other plugin working to your satisfaction. Doing this part first will make it easier because you can follow the plugin’s given directions without having to worry about how it will impact LiteSpeed’s setup. Before you install and activate LiteSpeed Cache, you should first get the other plugin working to your satisfaction. Doing this part first will make it easier because you can follow the plugin’s given directions without having to worry about how it will impact LiteSpeed’s setup.
  
-Once the plugin is installed, activated, and set up to your liking, ​**purge that plugin’s cache** to ensure there are no conflicts from the start, and then **disable ​its full-page ​cache functionality**.+Once the plugin is installed, activated, and set up to your liking, ​//purge that plugin’s cache// to ensure there are no conflicts from the start, and then //disable ​the cache and all of the duplicate optimization functions that you plan to use in LSCWP//.
 ===== Setting up LSCWP ===== ===== Setting up LSCWP =====
  
-[[litespeed_wiki:​cache:​lscwp:​installation|Install and activate LSCWP]]. Upon activation, you should see the following warning message:+[[litespeed_wiki:​cache:​lscwp:​installation|Install and activate LSCWP]]. Upon activation, you should see the following warning message:
  
-{{ :​litespeed_wiki:​cache:​lscwp:​customizations:​wpwzzb.png?​700 |}}+{{:​litespeed_wiki:​cache:​lscwp:​customizations:​wpwzzb.png?​800|}}
  
 This message indicates that there is another cache plugin activated and that it is using the WordPress ''​advanced-cache.php''​ file. This is normal behavior! If you see this warning, it means everything is working as expected. This message indicates that there is another cache plugin activated and that it is using the WordPress ''​advanced-cache.php''​ file. This is normal behavior! If you see this warning, it means everything is working as expected.
Line 26: Line 37:
 ===== Configuring LSCWP ===== ===== Configuring LSCWP =====
  
-Assuming you’ve seen the message above, the last step is to configure LSCWP not to use ''​advanced-cache.php''​. If the other plugin wants to use that file, we are going to let it do so. Navigate to **Settings → LiteSpeed Cache → Advanced**, and uncheck the ''​Check advanced-cache.php''​ option. ​(The box will be green when “checked” and gray when “unchecked.”)+Assuming you’ve seen the message above, the last step is to configure LSCWP not to use ''​advanced-cache.php''​. If the other plugin wants to use that file, we are going to let it do so. Navigate to **Settings → LiteSpeed Cache → Advanced**, and uncheck the ''​Include ​advanced-cache.php''​ option.
  
-{{ :​litespeed_wiki:​cache:​lscwp:​customizations:​wpwzzc.png?700 |}}+{{:​litespeed_wiki:​cache:​lscwp:​customizations:​lscwp-settings-advanced-annotated.png?direct&​800|}}
  
 Save your changes, and the warning should no longer display. If the message is still there, [[https://​wordpress.org/​support/​plugin/​litespeed-cache|let us know]]. Save your changes, and the warning should no longer display. If the message is still there, [[https://​wordpress.org/​support/​plugin/​litespeed-cache|let us know]].
  
-===== A Note about ExpiresDefault ===== +Enable ​the cache and any optimization features ​you wish to use with LSCWP.
- +
-A recent update to our plugin (version 1.1.4) added a warning that you might see: +
- +
-  ERROR 4010: In .htaccess file found one unexpected cache rule ExpiresDefault +
- +
-This will show up if your other plugin includes browser-caching functionality. We added the warning because browser cache can conflict with page cache and cause undesired behavior. +
- +
-To deal with this, edit your ''​.htaccess''​ file (in the root directory of your WordPress installation) and add the following line above the ''​ExpiresDefault''​ line: +
- +
-  ExpiresByType text/html "​access plus 0 seconds"​ +
- +
-(If an ''​ExpiresByType text/​html''​ rule already exists, either comment it out, or change it to match the 0-second rule above.) +
- +
-This rule will make it so that the pages that are cached by LSCWP are not included in the browser cache, but any other browser-cache behavior will remain unchanged. +
- +
-**Note:** As of v1.1.4, LSCWP will still put up a warning even after you’ve added this line. We’ll be changing that behavior ​with the next release, but until then, you can either ignore the warning, or insert a single space in front of ''​ExpiresDefault''​. If you add the space, the rule should still work as intended for the other plugin, but LSCWP will no longer detect it. +
- +
-If you have difficulty with this, drop by the support forum and [[https://​wordpress.org/​support/​plugin/​litespeed-cache|we’ll talk you through it]].+
  
 ===== Checking your work ===== ===== Checking your work =====
  
-At this point, you should have both plugins working together in harmony, but you’ll want to do a quick test, just to be sure. To verify that your pages are actually being cached by LiteSpeed:+At this point, you should have both plugins working together in harmony, but you’ll want to do a quick test, just to be sure. To verify that your pages are actually being cached by LiteSpeed, you can [[litespeed_wiki:cache:​lscwp:​installation#​testing|follow these steps]].
  
-  - Visit a page on your website while not logged in. +If the page was not cached by LiteSpeed, then something in your setup is not quite right. [[https://​wordpress.org/​support/​plugin/​litespeed-cache|Contact us]], if you need help!
-  - Reload the page. +
-  - View the page source (''​CTRL-U''​ or right-click,​ then “View Source”) +
-  - Scroll all the way to the bottom of the source code and check the last line. It should say something like: +
-  <!-- Page generated by LiteSpeed Cache on 2017-07-31 15:56:52 --> +
-If you don’t see the LiteSpeed Cache comment above, then the page was not cached by LiteSpeed ​and something in your setup is not quite right. [[https://​wordpress.org/​support/​plugin/​litespeed-cache|Contact us]], if you need help!+
  
-If you do see the LiteSpeed ​Cache comment above, then the setup is finished. Don’t forget to take a look at your LiteSpeed Cache settings and see if anything needs adjustment. In general, the default settings are fine, but you might want to tweak a few things since you’ve got the other plugin running, too.+If the page //was// cached by LiteSpeed, then the setup is finished. Don’t forget to take a look at your LiteSpeed Cache settings and see if anything needs adjustment. In general, the default settings are fine, but you might want to tweak a few things since you’ve got the other plugin running, too.
  • Admin
  • Last modified: 2020/11/14 15:25
  • by Lisa Clarke