How to Enable & Configure Redis Persistent Object Cache for WordPress

How to Enable & Configure Redis Persistent Object Cache for WordPress on Platform i

Some Platform i accounts include Redis, which gives you the ability to store persistent object cache in the server’s memory. This can help serve your site assets up faster resulting in better performance. There are several popular plugins available for enabling Redis in WordPress and managing your site cache.

This guide will explain how to configure and enable Redis object caching for your site hosted with Platform i. Then, we’ll show you how to validate if Redis is working using the command line.

Enable & Configure Redis Persistent Object Cache

When you want to manage Redis object caching for your WordPress website there are quite a few plugins available. In this section, we will go over the most popular up-to-date plugins that have the ability to enable and control object caching.

Using the Redis Object Cache Plugin

  1. Install the Redis Object Cache plugin by Till Krüss.
  2. After activating the plugin you should be redirected to the Settings page. If not you can click Settings then Redis in the WordPress Dashboard.
  3. Click the Enable Object Cache button.
    Enable Redis Object Cache

    You are finished when the Status is showing as “Connected” and the Drop-in is “Valid”.

Using the W3 Total Cache Plugin

  1. Install the W3 Total Cache plugin by BoldGrid.
  2. Go to Performance then General Settings in your WordPress Dashboard. (Another option is to use the W3 Total Cache Setup Guide to select Redis as your Object Cache)
  3. Scroll down to the Object Cache section and check the box for Enable.
    Enabling Persistent Object Caching
  4. Then select Redis from the drop-down box next to Object Cache Method.
  5. Click the Save Settings & Purge Caches button. You are finished when you see a message stating “Plugin configuration successfully updated.

Using the LiteSpeed Cache Plugin

  1. Install the LiteSpeed Cache plugin by LiteSpeed Technologies.
  2. Click LiteSpeed Cache then Cache in the navigation menu.
  3. Now click the Object tab.
    Accessing the Object Cache Settings in the LiteSpeed Cache Settings
  4. Click the On button next to Object Cache.
    Turning on Object Cache Settings
  5. Next to Method click the Redis button.
  6. Next to Port enter: 6379
    Setting the Redis Object Cache Port
  7. Click the Save Changes button. You are finished when you see a message stating “Options saved.

Using the WP Redis Plugin

  1. Install the WP Redis plugin by Pantheon.
  2. Now use the file manager to edit your wp-config.php file and add the following lines of code:
    $redis_server = array(
    'host' => '127.0.0.1',
    'port' => 6379,
    'auth' => '12345',
    'database' => 0,
    );
  3. Save your changes to the wp-config.php file.

Validate Redis is Working With CLI

  1. Connect to your server via SSH.
  2. Run the following command:
    redis-cli ping

    If it is working correctly you should see the following response:
    PONG

Congratulations, now you know how to enable, configure, and validate that Redis persistent object cache is working with your WordPress site hosted at Platform i!

Was this article helpful? Join the conversation!