This is Our Old blog with useful tutorials, We'll start posting tutorial In forum soon, please use this forum as blog is discontinued but will not been taken down Link to Forum
Control PanelCWPWordpress

How to Speedup WordPress and Decrease the Server Load with Redis Cache on CWP Centos WebPanel

You probably heard of APC/APCu, Opcache, Xcache which can significantly speed up WordPress or any type of supported php scripts. In this tutorial I’ll show you how to speedup WordPress with Redis Object cache since on CWP/Centos WebPanel opcache doesn’t supported because of SUPHP module. Now opcache is supported Check this link However we will continue with Redis Cache installation on CWP, SO lets get started.

Configure and Speed Up WordPress with Memcached on PHP 7

What is Redis Cache?

Redis is a fast, open source, in-memory key-value data structure store. Redis comes with a set of versatile in-memory data structures which enable you to easily create a variety of custom applications. Leading use-cases for Redis include caching, session management, pub/sub, and leaderboards. It is the most popular key-value store today. It is BSD licensed, written in optimized C code, and supports multiple development languages. Redis is an acronym for REmote DIctionary Server.

How to enable Redis in WordPress and in CWP?

Step ONE :

  • Go to CWPadmin (as root)
  • Select “PHP Settings” then select “PHP Version Switcher
  • Then Select “PHP Version” from the drop down, I will recommend php 7.0 or php 7.1
  • After that page will reload and you’ll see PHP option availble for installation (checkbox)
  • Navigate to bottom and find “redis” and check mark it then hit “Build” button, after the php rebuild process is completed you can check redis is running or not by this command:
service redis status

you’ll get output like this ( tested on centos 7, centos 6 have different output like “running” ):

[root@demo ~]# service redis status
Redirecting to /bin/systemctl status redis.service
* redis.service - Redis persistent key-value database
   Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/redis.service.d
   Active: active (running) since Wed 2017-12-27 05:36:47 EST; 1h 22min ago
 Main PID: 19389 (redis-server)
   CGroup: /system.slice/redis.service
           `-19389 /usr/bin/redis-server

at this point all is fine, now we’ll check php redis is installed correctly or not :

php -m | grep -i redis

the output will be like this :

[root@demo ~]# php -m | grep -i redis
[root@demo ~]#

if you get the phrase redis as output then all is okay and we’ll move forward with WordPress and Redis integration

Step TWO :

Before enabling redis-object-cache in WordPress, you have to add the following lines in your wp-config.php file.

define( 'WP_CACHE_KEY_SALT', '' );

replace with your site

  • Login to WordPress wp-admin
  • Go to “Plugins” >> “Add Plugin

You need to add this plugin : Redis Object cache

I assume you already installed the Redis Object cache plugin now navigate to Redis settings and click on “Enable Object Cache

After you enabled the redis cache it will show “Connected” like below image :

Congratulation you just enabled Redis cache for WordPress, and you’ll notice loads are now decreased and site is loading blazing fast.

Sandeep B.

I'm a system admin and php developer and currently working as System Admin In CWP Control panel, expertise in Linux and Windows administration RHEL certified admin.

Related Articles


      1. Hello,
        Do you mean redis better than varnish?
        actually i don’t want to use varnish. How do you think the best combination should be in cwp?
        thank you

        1. Use nginx + php-fpm >> redis cache (php-redis) it will be excellent combination and gives you performance benefits, you can also use nginx + apache + php-fpm >> redis cache (php-redis) its not great as nginx + php-fpm.

  1. Sorry I didn’t see your reply before. Just saw it now after I made the last comment. Thank you so much. is better than the centos web panel forum.

  2. If we want to uninstall redis then how? I recompiled php without redis but it seems to be there still.

    1. just remove this line from /usr/local/php/php.ini :

      and remove the redis :

      yum remove redis

Back to top button