How to configure WordPress plugins for LiteSpeed Cache?

Most plugins and themes can be used with LiteSpeed Cache out of the box, with no issues, requiring no additional configuration. However, some plugins require additional configuration because their features overlap with LiteSpeed Cache.

Partial list of these plugins:

  • Elementor
  • WooCommerce
  • Contact Form 7
  • Duplicator Pro
  • WP-Postviews
  • Ad Inserter
  • Autoptimize
  • Caldera Forms
  • iThemes Security Pro
  • WP REST API Authentication
  • WP Touch
  • YITH Wishlist
  • Yoast SEO

The full list can be found on the LiteSpeed website:

https://docs.litespeedtech.com/lscache/lscwp/thirdparty

If you use the plugins above, configure them as described below. Make sure to thoroughly test your site before going live after making any changes.

To install LiteSpeed Cache, refer to this guide:

How to install LiteSpeed Cache?

 

Cloudflare APO


If you are using Cloudflare, and APO is enabled, disable it in Cloudflare. You do not need to disable Cloudflare; only APO needs to be disabled.

Cloudflare APO's (Automatic Platform Optimization) caching and optimization features overlap LiteSpeed Cache's optimization features.

 

Elementor


Elementor is fully compatible with LiteSpeed Cache. It requires additional configuration to prevent conflicts between Elementor's optimizations and LiteSpeed Cache's page optimization features (CSS and JavaScript Minification and Combination, Lazy Loading, and Image Placeholders).

 

Set the following values in Elementor Settings > Performance:

  1. CSS Print Method: Do not change if the website frontend is working as expected.

  2. Optimized Image Loading: Disable

  3. Optimized Gutenberg Loading: Enable

 

Go to Elementor Settings > Features and set the following values:

  1. Inline Font Icons: Active

  2. Additional Custom Breakpoints: Inactive

  3. Lazy Load Background Images: Inactive

 

WooCommerce


Configure these settings if you use WooCommerce:

 

Enable ESI (Edge Side Includes):

  1. Log in to WordPress Dashboard.

  2. Go to LiteSpeed Cache > Cache > ESI.

  3. Set "Enable ESI" to "ON".

  4. Save Changes.

 

Product Update Interval:

  1. Log in to WordPress Dashboard.

  2. Go to LiteSpeed Cache > Cache > WooCommerce.

  3. Select an option that suits your use case.

  4. Save Changes.

 

ESI is especially needed for the "Recently Viewed Products" widget. More information on what ESI is and why you might need it:

https://docs.litespeedtech.com/lscache/lscwp/cache/#esi-tab

More information on "Product Update Interval" can be found here:

https://docs.litespeedtech.com/lscache/lscwp/cache/#product-update-interval

 

Contact Form 7


LiteSpeed Cache:

 

  1. Purge cache after creating/editing a form.

  2. Set TTL to 24 hours (86400 seconds) or less.

 

Custom JavaScript:

If you add custom values to your form using JavaScript, add the following line before your code. Do not add it if you do not add custom values using JavaScript:

wpcf7.cached = false

CF7 resets all forms on load when cache is enabled, and loses any changes made via JavaScript. The above code prevents the form from resetting.

 

Duplicator Pro


Add the following code to your cache root .htaccess file:

# BEGIN LiteSpeed noabort
<IfModule rewrite_module>
RewriteEngine On
RewriteRule (wp-cron|duplicator-pro-main|duplicator-pro)\.php - [E=noabort:1]
</IfModule>
# END liteSpeed noabort

 

WP-Postviews


It is incompatible with LiteSpeed Cache. You can manually modify the plugin to make it compatible:

Replace the following code:

<?php if(function_exists('the_views')) { the_views(); } ?>

With this code:

<div id="postviews_lscwp"></div>

Replace the Ajax query in wp-content/plugins/wp-postviews/postviews-cache.js with the following code:

jQuery.ajax({ type:"GET", url:viewsCacheL10n.admin_ajax_url,
     data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",
     cache:!1, success:function(data) {
     if(data) { jQuery('#postviews_lscwp').html(data+' views'); } } });

 

Note:

Any changes you make directly to plugin files will be lost after updating the plugin.

 

Other Plugins


The following is a partial list of other plugins that require additional configuration.

 

Ad Inserter: Incompatible when Ad Inserter has Caching enabled.

Autoptimize: Uninstall Autoptimize or disable LSCWP Page Optimization features.

Caldera Forms: Set Enable ESI to ON in Cache > ESI.

iThemes Security Pro: Add /wp-content/plugins/litespeed-cache/guest.vary.php to allowlist.

WP Touch: Set Cache Mobile to ON in Cache > Cache.

Yoast SEO: Purge cache on activation/deactivation.

 

WP REST API Authentication

Incompatible with optimization features. It blocks the /litespeed/v1 REST API endpoint, which is required for all optimization and CDN services provided via QUIC.cloud

 

YITH Wishlist

Define CacheEngine on esi combine (or CacheEngine on crawler esi combine if you are using the crawler) in the Apache config file.*

*Available on VPS, Quasi, and Dedicated Servers only.

 

  • 436 Users Found This Useful
Was this answer helpful?

Related Articles

How to change WordPress admin password?

The admin password of WordPress can be changed in multiple ways without knowing the password....

How to automatically update WordPress using Softaculous?

You can automatically update WordPress using Softaculous. By default, Softaculous updates WP core...

How to clone or stage a WordPress website using Softaculous?

  A staging site or clone allows you to test website settings, plugins, and themes before...

How to clone or stage a WordPress website using WP Toolkit?

  WP Toolkit allows you to clone your existing website. You can use the cloned site as a staging...

How to enable Redis object cache in WordPress?

Redis object cache can improve performance for some websites that perform heavy database queries....