Start a Project

How to Configure Redis Session in Magento2

What is Redis?

Redis is a free and open-source in-memory data structure store that can be used to function as a database, cache, or message broker. It is known for its great performance, ease of use, and versatility.

Its main purpose is to store data in key-value, where each key is associated with a value. It also offers various types of data structures like strings, lists, sets, hashes, etc.

However, It mostly stores the data in RAM, which allows highly rapid and performance operations. It also allows you to save data to disc on a regular basis or on an ad hoc basis.

Therefore, with its help, you can reduce the stress on databases or other back-end systems by caching data in Redis which allows for a decrease in the response time of the application.

How to install Redis?

To set up a Redis session in Magento, it should be installed on your server. If it is not installed on the server, you can install it using the below command in the Ubuntu system.

For installation on other OS Click here!

Verify the status of the Redis service

After installing the service, you can check the status of the service by using the below command

you should get the below output which simply shows that the service is up and running.

How to Configure Magento2 to use Redis for session storage?

Magento2 now supports Redis session storage configuration through the command line, to enable this you need to run the below-mentioned command in the document root path of Magento.

and then press ‘Y’

To verify that Redis and Magento are working together, use the following command:

Refresh your storefront page and you’ll see output similar to the following

Need Support?

Thank You for reading this Blog!

For further more interesting blogs, keep in touch with us. If you need any kind of support, simply raise a ticket at https://webkul.uvdesk.com/en/.

You may also visit our Odoo development services and quality Odoo Extensions.

For further help or query, please contact us or raise a ticket.

Exit mobile version