Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  WordPress FAQ  >  Learn to Configure Redis for WordPress
Top Scroll

Learn to Configure Redis for WordPress

 3 min

Are you looking for an option that speedily caches your WordPress site? Redis is the best. REDIS stands for REmote Dictionary Server and is an open source, key-value store. In case you aren’t a tech geek then this might sound like a technical mystery. In simple terms, it is very fast. Redis doesn’t access your hard drive and instead works within RAM. This is what helps it to improve the WordPress performance. Redis is offered on your VPS or Dedicated server.

Note: This article is application only to VPS or Dedicated servers in order to improve WordPress website performance.

In this article, you will learn to set up the Redis Object Cache plugin that is easily installed within your WordPress site. Check the steps below for installing and then using the Redis Object Cache plugin to improve the performance of your WordPress site.

Steps to Install Redis Object Cache

  1. Login to your WordPress Administrator Dashboard.
  2. Go to Plugins.
  3. Click on Add New.
  4. Type “Redis” in the search field. This will search and display the plugins available for Redis. There will be multiple plugins, but the plugin that you need to look for is Redis Object Cache.
  5. Then click on the Install Now button for Redis Object Cache.
  6. After the installation is complete, click on Activate.

With this, the Redis Object Cache plugin is successfully installed for WordPress. Since the plugin has only a few options, you can easily implement it if the Redis on your VPS/Dedicated server is properly running. Now let’s check the steps to enable the Redis Object Cache plugin.

Steps to Enable the Redis Object Cache

When you check the Redis Object Cache settings for the first time, you will land to the page that is displayed above.

  • Ensure that the cache status is set to Disabled.
  • Now, click on Plugins which will display a list of plugins that you have installed and activated.
  • Search for Redis Object Cache and then click on Settings. You can even go to the Settings in your WordPress menu and click on Redis.
  • Next click on Enable Object Cache to turn on the cache. With this, the plugin will connect to the server using the default port of 6379. If you don’t know how to open the port, then contact our live technical support team for assistance.
  • Now click on Show Diagnostics to see if the plugin is connected. The screenshot below displays the plugin is running.

Configuration Parameters for Redis

You can manually do some settings for the the Redis Object Cache plugin. Check below a few settings listed on the page:

Note: You can add all of these configuration settings to the wp-config.php file in your WordPress installation.

  • WP_CACHE_KEY_SALT (default: not set) – With this parameter, you can ensure that each cache key is unique. This parameter can be used when you have multiple WordPress installations with the same wp-config.php file.
  • WP_REDIS_SELECTIVE_FLUSH (default: not set) – This option can be used if you want to only flush specifically prefixed caches (using the WP_CACHE_KEY_SALT). In case, you aren’t using this setting then the full Redis database would be flushed.
  • WP_REDIS_MAXTTL (default: not set) –The maximum “time to live” can be set with this parameter for cache keys that have their expiration time set to 0.
  • WP_REDIS_GRACEFUL (default: not set) – When you set this parameter to false, then friendly (graceful) failures get disabled and this enables you to see errors/exceptions.

Generally, you may see performance improvement by using the default settings, but you will find several other settings that can be used if needed for your specific WordPress installation. In these settings, there are connection parameters and options for replication & clustering. For viewing the comprehensive list, you can go to the Redis Object Cache plugin page on the WordPress webpage. The list of settings will be displayed on the Details tab of the plugin.

In this way, you can configure Redis for improving the performance of your WordPress website.

Also Read:
What Is Redis And How To Install It?

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.