Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

How to Setup Redis Cache on Magento Backend

June 8, 2017

4 Min Read
setup magento redis
Reading Time: 4 minutes

Warning! This requires some technical changes in your Magento app. Therefore, we recommend that developers test this method on a staging website first.

If you need an exceptionally versatile data store shared by different procedures, numerous applications, or various servers then configuring Magento, Redis cache is the best decision you will take.

Magento supports many backend caches with the help of the Zend Framework. Memcache and APC are commonly used. However, nowadays Redis is fast becoming a popular and powerful caching system for use with Magento and other web applications. This is why it is important that developers should know how to configure Redis cache on Magento backend.

What is Redis Cache?

Redis cache lets you impart cross-stage, cross-server, or cross-application and makes it an excellent choice for numerous utilization cases. Its speed, likewise, makes it incredible as a cache layer.

Redis has a virtual memory, where once in a while utilized keys would be swapped out to circle so that only the keys needed to fit into the memory are used. Going ahead, the utilization cases for Redis are those where it’s feasible for the whole information set to fit into the memory.

The essential point of interest of utilizing Redis cache is that store labels are upheld. The moderate-level file system cache is no longer needed to be utilized. This Magento cache backend is prescribed in multi-server situations where you have more than one web server.

Scale Your Magento 2 Store With Ease

One-Click Magento installation with your own managed hosting solution.

In this article, I am going to demonstrate how you can connect Magento, Redis cache using Cloudways Managed Magento Hosting Platform.

  1. Enable Redis Using Cloudways Platform
  2. Configure Redis With Magento
  3. Check if Redis is Working?

Enable Redis Using Cloudways Platform

  1. Sign in with your Cloudways account and click on your Server.

Select Server Cloudways

  1. Server Management console appears and click on Settings and Packages section.

server management console Cloudways

  1. In Setting and Packages, click on Packages tab.

navigate to packages Cloudways

  1. Now install the Redis as shown.

Install Redis Cloudways

5. Click on Manage Services.

Navigate to manage services Cloudways

6. In Manage Services, start the Redis.

Start the Redis Cloudways

Redis is now enabled on your Cloudways server.

Configure Redis With Magento

In the next step of configuring Magento, Redis cache, you need to edit a couple of files. In Magento 1.9 there is a built-in Redis module, Cm_RedisSession.xml. To activate it, you need to access it through SFTP. You can find SFTP access details in Master Credentials.

SFTP access details Cloudways

Navigate to app/etc/modules/Cm_RedisSession.xml and open it in a text editor.

Change the value of <active> to true.


Save your changes to Cm_RedisSession.xml and exit the text editor.

Following code configures your Redis cache backend that you can use with your database index to hold a cache of your Magento store. Go to your local.xml file to tweak the code.

Here is the code that you need to copy and replace in your local.xml file. You can see your local.xml file under your magento root directory app/etc/local.xml.


Note: Use this code after <session_save><![CDATA[files]]></session_save>

Once edited, save your local.xml file. Then go to your var folder and delete all files and folders under the var/cache. Magento will rebuild the cache after a few hits on the website.

Check if Redis is Working?

Now check whether Redis Cache is working and connected with your Magento store or not. For this, Go to Server Management.

Launch SSH terminal Cloudways

In Server Management,click Launch SSH Terminal and use these two commands to check whether Redis Cache is working fine or not:

  • To check if Redis is working on the server, use this command redis-cli ping. (If you receive your PONG, you can proceed.)
  • In order to determine whether Redis configuration on your Magento store has been successful, use the redis-cli monitor command in the SSH Terminal. Each time your website is refreshed, you to view command line information of communication between your site and the Redis cache. To end the monitoring session, press Ctrl+C.


  • For verifying PhpRedis, use this command php -m | grep redis. If you receive Redis. As a result, it’s mean your Redis cache is enabled and working fine with your Magento store.


Final Thoughts

Enabling Redis on your Magento store will make it swifter. Users can deploy applications like Magento, WordPress, Laravel, Joomla, and PHP Stack in one-click on Cloudways. This is why it is essential that magento developers should know how to setup Redis cache in Magento backend.

The optimization formula of Cloudways uses Apache, Nginx and now, Redis. This unique combination significantly improves the performance of your web applications. Sign up now for a free trial of Cloudways Redis Cloud Platform.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Boost Your Magento Store Performance by 5x Times & Maximize Your Sales

Our fastest Magento hosting can help you in growing your business revenue by 500%

Fayyaz Khattak

Fayyaz is a Magento Community Manager at Cloudways - A Managed Magento Hosting Platform. His objective is to learn & share about PHP & Magento Development in Community. Fayyaz is a food lover and enjoys driving. You can email him at

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!