1. Home
  2. Docs
  3. LearnDash Addons
  4. LearnDash Redis Object Cache

LearnDash Redis Object Cache

The LearnDash Redis Object Cache add-on uses Redis, Memcached, and APCu Object Cache to cache your LearnDash site’s content. By using this addon, the number of database requests and queries running simultaneously on a page is reduced. This results in faster data fetching and page loading times. Our LearnDash Redis Object cache is tailored for the LearnDash and WooCommerce plugin in order to optimize your server’s performance on high traffic.

Note: 

  • To make use of this plugin, first enable the Redis Object Cache or Memcached extension, available for free, from your hosting provider.
  • It initially prioritizes Redis and, if detected, operates with it. If Redis isn’t available, it seamlessly transitions to Memcached and, as a final option, utilizes APCu.
  • This add-on will not cache the website’s static content e.g. images, CSS, js, fonts etc.

How to Check:

To check the Redis Object Cache extension’s activation status, you can use Query Monitor free plugin. You have to follow these steps:

  • Install and activate the Query Monitor.
  • After activating the ‘query monitor menu’ will be added to the top admin bar. 
LearnDash Redis Object Cache – Query Monitor
  • On clicking it, the ‘query monitor window’ will be opened. Where you can check the Redis Object Cache extension’s activation status:
LearnDash Redis Object Cache – Not Installed
LearnDash Redis Object Cache – Installed but Disabled
LearnDash Redis Object Cache – Enabled

Similarly, you can check the Memcached extension’s activation status.

Table of Content

  1. Installation
  2. License Option
  3. General Settings
  4. Groups
  5. Exclude Pages
  6. Example
  7. FAQ
  8. Changelog

Installation

  • Install the LearnDash plugin & activate it.
  • Install the LearnDash Redis Object Cache add-on and activate it.
  • A new sub-menu labelled “LD Cache” will be added under the “Settings” menu on the WordPress dashboard.
LearnDash Redis Object Cache – Main Menu

License Option

You can configure your add-on’s license key from the License Option tab. Enter a valid license key in the corresponding field to receive automatic updates for this product.

LearnDash Redis Object Cache – Licensing

General Settings

LearnDash Redis Object Cache – General Settings

This tab displays the status and the database connection information for the Redis, Memcached or APCu object cache, when enabled.

LearnDash Redis Object Cache – Connection Information

At the bottom of the General tab, you will also find a button labeled “Flush” that refreshes and resets the object cache.

Groups

The Groups tab allows you to add or exclude the WordPress groups that the add-on will work with.

LearnDash Redis Object Cache – Manage Groups

Exclude Pages

The Exclude Pages tab allows you to exclude specific WordPress frontend pages from the add-on’s functionality.

To exclude a page, copy the slug of the page and paste it in the “Exclude Pages” field, as shown in the image below. Place a forward slash “/” before and after the page’s slug and click on the  “Update Settings” button.

LearnDash Redis Object Cache – Exclude Pages

Note: Deactivating the add-on without disabling the Redis Object Cache may cause issues because the Redis/ Memcached database will remain connected. It’s advisable to disable the Redis object cache before deactivating the add-on.

Example

This is an example of how the number of queries is reduced with LearnDash Redis Object Cache enabled:

Plugin used: Query Monitor 

Number of Queries when LearnDash Redis Object Cache is Disabled
Number of Queries when LearnDash Redis Object Cache is Enabled

FAQ’s

Why is an error warning displayed on the WordPress dashboard after the Redis Object Cache is enabled?

To avoid getting this error warning, please make sure to enable the Redis Extension that is provided by your hosting provider before using this add-on. 

My hosting provider doesn’t offer any Redis or Memcached extension. Can I use this add-on?

You can still use the add-on, by manually adding the Redis or Memcached into PHP.

Is there an option that allows me to renew or reset the Redis Object Cache?

The “Flush” button, located on the General tab, resets the Redis Object Cache with a single click.

Is this plugin also optimized for other plugins?

By default, this plugin caches all the objects if there are no cache groups selected in the excluded groups from the excluded groups settings.

Can this plugin be used for caching static content?

No, this plugin is only for internal applications and caches query data into the object cache.

Are there any settings regarding the expiry of Redis Object Cache?

No, currently cached objects are set to lifetime, you have to manually flush the cache, using the “flush” button, to renew the objects.

How many optimizations in the page load speed should I expect on front-end & back-end?

In its current version, the add-on optimizes the page load speed 15% to 20% on the back-end and reduces the TTF. As a result, pages are optimized on the front-end as well.

How is LearnDash Redis Object Cache different from other Redis Cache plugins on the market?

Other Redis Cache plugins are generic and are not tailored for LearnDash LMS. With other plugins, the Redis Object Cache has issues generating LearnDash reports. However, the LearnDash Redis Object Cache add-on has handled these issues and optimized its performance.

What LearnDash queries are added into the cache and which ones are excluded from the cache by default?

By default objects/arrays responses are added into the cache and the objects/arrays of the LearnDash reports and WooCommerce sessions are excluded.

Are there any drawbacks, conflicts that I should be aware of if I use plugins like EasyDigitalDownload & PMPro so I can decide if this plugin is good for me or not?

Generally, this plugin does not have any drawbacks or conflicts because object-cache class is the same as the default WordPress cache class, it simply overrides the default class with additional features like including/excluding groups, managing expiry, and hosting cached objects in Redis which is a super-fast key-value database.

How is this plugin different from other cache plugins like WP Super Cache, WP Rocket Cache, W3 Total Cache, etc?

This plugin caches the internal application queries/objects into the Redis key-value database, from where it serves the database requests to reduce the server load. On the other hand, the WP Super Cache, WP Rocket Cache, and W3 Total Cache plugins have been developed to cache browser-level content such as images, CSS, js, fonts, etc.

My host offers a back-end cache, how would this plugin work for me? 

The Server-level cache provided by hosts is not optimized for specific scenarios, which may lead to unexpected website behavior. This add-on has been developed specifically for LearnDash LMS & WooCommerce, while also optimizing other website features. 

What’s the difference between host cache and our Redis plugin cache?

There are different types of caches provided by hosts, for example, Redis Object, Memcached, and Opcode. These host-provided caches are generic and most of the time are not customizable.  Therefore, it is recommended to use the custom-developed LearnDash Redis Object Cache with an easy user interface where you can easily flush the cache with a single click.

How can I check if the plugin is working and optimizing the pages?

You can check this from the Admin panel by using the Query Monitor plugin which displays the number of queries executed on each page, as seen on this image. You can also check the optimization of the pages using GTmetrix and PingDom

What if I need further optimization, do you have a plan or can you help with general site optimization?

There are various factors that we can help you optimize for your website including caching queries/objects, static content images, CSS, js and fonts, Server configuration, and managing server resources for optimization. You can contact us at this link.

Can you please clarify what you mean by optimization for WooCommerce & LearnDash?

When object caching is enabled, dynamic parts of WooCommerce & LearnDash websites will load quicker and put less strain on the database server leading to a better experience for the end-user.

What to do if all the dynamic data-driven applications, like LearnDash and WooCommerce, cannot properly retrieve new data with caching enabled?

It is not about having caching enabled causes LearnDash and WooCommerce to not properly retrieve new data, however, it is the misconfiguration of caching plugin where you might have not excluded the groups/pages from caching.

Following are the details of LearnDash & WooCommerce to exclude the dynamic parts that may cause issues and these are required to be excluded from caching.   

LearnDash:

  • Exporting Course or Quiz data (Second last question in the below link)

Source: https://www.learndash.com/support/docs/reporting/propanel/

WooCommerce:

  • Cart
  • MyAccount
  • Checkout

Source: https://docs.woocommerce.com/document/configuring-caching-plugins/

Static / non-dynamically driven pages and posts are fine with caching, but if you cache anything dynamic, at best you’ll get old data mixed in with the new data and have a mess on your hands until it’s cleared.

For dynamic data, WordPress has a special WP_Object_Cache class for caching the result of complex database queries, which may be computationally expensive to regenerate, to reduce your server load.

By default, the object caching is non-persistent, data stored in the cache resides in memory only and only for the duration of the request.

The object cache has functionalities to retrieve new dynamic data using a unique key passed in the request for the cache object.

Is it safe setting up Cloudflare for LearnDash?

This option will enable full-page caching on your Cloudflare CDN server edges. This will reduce the load on your server and improve the loading speed of your pages because by default Cloudflare will cache only your static resources.

Is the add-on compatible with the latest version of PHP?

Yes, the add-on fully supports and works well with the latest versions of PHP.

Is the add-on compatible with the latest version of Redis, Memcached, OpCode?

Yes, the add-on fully supports and works well with the latest versions of Redis, Memcached, OpCode.

How to use this add-on on the site which has any other caching plugins?

To use this add-on first disable the Object Cache from any previously installed cache plugins e.g LiteSpeed, W3 Total Cache, etc, uninstall them and remove the drop-ins (object-cache).

If I installed Redis Object Cache, Do I need to uninstall other cache plugins (like W3 Total Cache)?

If other cache plugins also offer Object Cache optimization then they may conflict. So it’s recommended to uninstall other cache plugins when you install the LearnDash Redis Object cache plugin.


Changelogs

1.2.0

  • New: Added Memcached support.
  • New: Added APCu support.

1.1.1

  • Fix: Fixed report export functionality error.

1.1.0

  • New: Added multisite and network support.

1.0.1

  • New: Added new BuddyBoss non-persistent groups
  • Fix: Fixed compatibility issue with LearnDash v3.4.1.1
  • Fix: Fixed compatibility issue with BuddyBoss Theme v1.6.6
  • Fix: Fixed compatibility issue with BuddyBoss Plugin v.1.5.7

1.0

  • Initial

How can we help?