Step-1 (Install the Redis packages)
$ sudo apt-get install redis-server php-redis
Step-2 (Check that it is working or not)
$ sudo redis-cli
Type the given command
This means Redis works. Now type
exit to exit from Redis-cli.
Step-3 (Setup max memory and its rules for Redis)
$ sudo vi /etc/redis/redis.conf
Find the given lines
replace it with
after all edit done then
:wq to save and exit
Step-4 (Restart the services to make changes in effect)
$ sudo systemctl restart redis-server
Step-5 (Add Redis cache to WordPress configuration file)
wp-config.php file and add these lines to the last of the file.
define( 'WP_CACHE', true ); define( 'WP_CACHE_KEY_SALT', 'techbrown.com' );
After that save and exit
Step-6 (Enable Redis object cache to your WordPress)
Finally you need to install the WordPress plugin – Redis Object Cache to enable the Redis object cache. After installation of plugin now you are ready to use the flush cache option from above plugin settings.
Now you are ready to use the Redis Object cache with your WordPress instances on Ubuntu 16.04 distro. After enabling the Redis object cache you will see some improvement in pagespeed. It makes your WordPress site more faster than ever. If you have any questions regarding the above article you need to use the comment section below.