Connect with us

Hi, what are you looking for?

Linux

How to Configure Redis Object Cache for WordPress on Ubuntu 18.04

How to Configure Redis Object Cache for WordPress on Ubuntu 16.04. The Redis object cache is the type of cache solution suitable only for object cache. This type of cache stores data from database queries into a memory for fast access of data. It works so effectively with relational databases like MySQL, etc. When WordPress page is loaded it perform database queries to retrieve information it requires some time to perform database queries and by default Redis performed to store that database queries into a memory so that the page load time slight deceases hence you will get fast page loading times. You need to follow all the details so carefully to integrate the Redis object cache on your WordPress instances.

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

127.0.0.1:6379> ping

Output

127.0.0.1:6379> PONG

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

Advertisement. Scroll to continue reading.
# maxmemory

replace it with

maxmemory 256mb

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)

Now edit 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.

Advertisement. Scroll to continue reading.

Final Words

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.

Comments
Advertisement
Advertisement

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Linux

If you forget a root password of your RHEL 8 and CentOS 8 and want to reset the password so that the RHEL 8...

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Linux

How to Upgrade WordPress Server from Ubuntu 16.04 to Ubuntu 18.04. Right now, Ubuntu 18.04 has been released with tons of new features. Upgrading...

Linux

How to Enable TLS 1.3 on Nginx Web Server. Nginx is a ultra fast web server optimized for modern web applications and servers. TLS...

Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...