WpW: Using Multiple Cache Plugins

Written by

in

Welcome to another installment of WordPress Wednesday!

Please Note: At the time of this writing, the LSCache plugin did not support optimization features other than caching. Since then, our little plugin has come a long way! We support combination, minification, image optimization, and a host of other features. You shouldn’t need to use other optimization plugins alongside LSCache. However, if you still want to do so, the information in this post is still valid. 

The most important rule when using multiple optimization plugins together: don’t duplicate functions. In other words, if you have cache enabled in one, don’t enable cache in the other. And if you are minifying CSS in one, don’t minify CSS in the other. And so on.

Today we’re going to talk about how to use other cache plugins alongside LiteSpeed Cache for WordPress. While LSCache is the only full-page WordPress cache you need, we know that there are other plugins that include features not available from LiteSpeed, like minification, lazy image loading, database caching, etc.

The good news is that you can easily use these other plugins right next to LiteSpeed Cache. Read on, and we’ll show you how!

Is the other plugin a good choice?

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:

  1. not include a full-page cache at all, or
  2. include a full-page cache that can be disabled.

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.

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.

Setting up LiteSpeed Cache for WordPress

Install and activate LSCWP. Upon activation, you should see the following warning message:

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.

If you don’t see the above message, we need to figure out why. Try refreshing your screen a few times. If it’s still not there after that, it can mean one of two things:

  1. The other plugin you installed doesn’t use advanced-cache.php
  2. There is an underlying issue that needs to be addressed

In either of these cases, it’s best to let us know. We’ll be able to tell you if this is normal for the other plugin you’re using, and if it’s not, we can troubleshoot the underlying issue.

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.”)

Save your changes, and the warning should no longer display. If the message is still there, let us know.

A Note about ExpiresDefault

A recent update to our plugin 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.

As of this writing, 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 we’ll talk you through it.

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:

    1. Visit a page on your website while not logged in.
    2. Reload the page.
    3. View the page source (CTRL-U or right-click, then “View Source”)
    4. 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. Contact us, if you need help!

If you do see the LiteSpeed Cache comment above, then congratulations! LiteSpeed will now handle the page-caching duties, and the other plugin will handle whatever it is that the other plugin handles. 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!

Have some of your own ideas for future WordPress Wednesday topics? Leave us a comment!

Don’t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:

Comments

8 responses to “WpW: Using Multiple Cache Plugins”

  1. snake Avatar
    snake

    I moved to a host that uses Litespeed, so have switched to LScache plugin, but I am still getting this error even though I have removed all other caching plugins.

    LiteSpeed has detected another plugin using the “Advanced Cache” file. LiteSpeed Cache does work with other optimisation plugins, but only if functionality is not duplicated. Only one full-page cache may be activated. If this is the case, the network admin may uncheck “Check Advanced Cache” in LiteSpeed Cache Advanced settings.

    1. Lisa Clarke Avatar
      Lisa Clarke

      Probably one of the other plugins you used to use didn’t clean up properly after itself.

      If you are certain that you do not have any other cache plugin installed and using that file, it’s safe to delete it. You can find it in wp-content/advanced-cache.php. That’s the best option, but if you don’t want to delete it, you can go to LiteSpeed Cache > Settings > Advanced and uncheck the Check Advanced Cache setting. Save the settings and the error should go away.

      Welcome to LiteSpeed 🙂

  2. Da Avatar

    Which plugin you recomend to work B2B with LiteSpee ?! I heared many people are combyning it with Hummingbird

    1. Lisa Clarke Avatar
      Lisa Clarke

      Technically, you shouldn’t need any other plugin. The only reason to use another plugin alongside LiteSpeed is if that plugin has some optimization feature that LiteSpeed doesn’t have, or you like one of their implementations better than ours.

      If you are finding that your site’s performance is not improved enough with LiteSpeed, there may be something in your configuration that can be easily adjusted. You can create a ticket through our client area or by sending email to support@litespeedtech.com if you’d like help with that.

  3. Da Avatar

    PS: I have combined Hummingbird and LiteSpeed but as before and the same is affter combination of both.. No big cnhange… All options needed are on.. change ZERO…. quickmarket.co.uk is the website. Before on my old website I was using only hummingbird and it was on google page speed 40 for mobiles and for desctop over 70 precent, now with litespeed was 4 for mobile and 40 for desctop, after combining, 6 for mobile and 50 for desctop…………………………….. I got new hosting exactly for this feature…

    1. Lisa Clarke Avatar
      Lisa Clarke

      It definitely sounds like something in your settings needs to be adjusted. Create a ticket and our support team will make some suggestions.

  4. Singpho Avatar
    Singpho

    Now, I understand I am able to use smoothly two cache Plugin together…
    wp-super-cache + lscache without any issue as being said above…

    ⚡advanced-cache.php is not being used by lscache by default in latest version, so letting WP super cache Plugin to use smoothly.brilliant

    Great job lscache

  5. Pushpendra Jaat Avatar

    Is Lite speed cache plugin works good for business website.

Leave a Reply

Your email address will not be published. Required fields are marked *