Hướng dẫn sử dụng Redis ensuring the speed of a Drupal 7

Even Drupal, a CMS known for speed, get slow as the size of the website increases beyond a manageable size. This is when the visitors start to notice the lag-ridden performance of the Drupal 7 website.

An important way of ensuring the speed of a Drupal 7 is to use a caching technology that reduces the load on the server. One of the most popular caching methods is Redis. The good news is that Cloudways allows 1-click installation of Redis on your server.

Download and Install Redis Module

The very first thing you need to do on your Drupal 7 website is to download and install the Redis module. Remember to enable the module after installation.

Edit settings.php

After you have installed the module, you need to edit the settings.php file in the Drupal installation. This file is located in the sites > default folder. You could either use the shell access or an FTP software (Filezilla is a good choice) to edit this file. Insert the following code at the end of the file:

/* Redis config
* Please leave the settings below untouched
*/
 $conf['cache_backends'][]            = 'sites/all/modules/redis/redis.autoload.inc';
 $conf['cache_class_cache']           = 'Redis_Cache';
 $conf['cache_class_cache_menu']      = 'Redis_Cache';
 $conf['cache_class_cache_bootstrap'] = 'Redis_Cache';
 $conf['lock_inc'] = 'sites/all/modules/redis/redis.lock.inc';
 $conf['path_inc'] = 'sites/all/modules/redis/redis.path.inc';
 $conf['redis_client_host'] = ‘127.0.0.1';
 $conf['redis_client_port'] = ‘6379’;
 $conf['redis_client_password'] = ‘’;

Save and close the file after you are done with it.

Check if Redis is Working

Go to Drupal’s CLI and enter the following command:

redis-cli monitor

Keep the CLI open and carry out several actions on your website. Now check the CLI window and you will notice that a number of lines have been generated. This means that the Redis installation is working perfectly on your website.

Fivestar: 
Average: 3 (2 votes)