Properly Configure Redis
Redis is a Remote Dictionary server, is a fast, open source, in-memory, key value data store.
Redis is used for PHP session storage.
Backend support tag-based cache-cleanup without foreach loops.
Redis magento 2 configuration for default caching
Run the Setup:config:set command and specify parameters that are specific to Redis default caching.
$bin/magneto setup:config:set–cache-backend-redis-=
Where
To enables the Redis default caching.
–cache-backend=redis
is a list of key/value pairs that configure the defualt parameter.
–cache-backend-redis-
is a list of key/value pairs that configure the default caching.
Example:
$ bin/magento setup:config:set –page-cache=redis –page-cache-redis-=
Configure Redis Page caching
To configure Redis page caching on magento.run the setup:config:set command with additional parameters
$bin/magento setup:config:set –page cache=redis –page-cache- redis-=
Where
To enable Redis page caching.
–page-cache-=redis
is a list of parameter pairs that configure page caching
— page-cache- redis-=
Example:
The following example enables Redis page caching sets the host to 192.168.1.2 and assign the database number to 2
basically parameters are set to the default value.
$ bin/magento setup:config:set –page-cache-redis-server=192.168.1.2 –page—cache-redis-db=1