Monday, February 7, 2022

Integrate Redis with Magento 2

 Description: Here I have explained, How to install and Integrate Redis with Magento.

Install Redis using apt command 

# apt-get install redis

After installation start and enable redis service 

# systemctl start redis

#systemctl enable redis

# systemctl status redis


Verify the installation using redis-cli command 



We can integrate redis with magento 2 ways, 

1> Edit the  configuration similar to the following to app/etc/env.php

'cache' => array( 'frontend' => array( // Default Cache 'default' => array( 'backend' => 'Cm_Cache_Backend_Redis', 'backend_options' => array( 'server' => '127.0.0.1', 'database' => '0', 'port' => '6379' ), ), // Full page cache 'page_cache' => array( 'backend' => 'Cm_Cache_Backend_Redis', 'backend_options' => array( 'server' => '127.0.0.1', 'port' => '6379', 'database' => '1', 'compress_data' => '0' ) ) ) ),

2> Also configure same using command line as follow

# php bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=127.0.0.1 --cache-backend-redis-db=10 --page-cache=redis --page-cache-redis-server=127.0.0.1 --page-cache-redis-db=11 --session-save=redis --session-save-redis-host=127.0.0.1 --session-save-redis-log-level=3 --session-save-redis-db=12

No comments:

Post a Comment