2.13.9.8. Setting up Redis in Magento

  1. Connect to hosting via SSH.
  2. Change to the directory where it was installed CMS Magento by running the command:
    cd example.com/www/

    Instead example.com/www/ specify the path to the desired directory.

  3. Tune Redis possible for system caching and for page caching. Both types of caching can work in parallel if different database identifiers are specified for them. To configure the appropriate caching, run the desired command:
    bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=/home/example/.system/redis.sock --cache-backend-redis-db=X

    In the team instead of example indicate hosting account name, in which the site is located, and instead of X — specify the desired Redis database identifier.

    bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=/home/example/.system/redis.sock --page-cache-redis-db=X

    In the team instead of example indicate hosting account name, in which the site is located, and instead of X — specify the desired Redis database identifier.

Warning!

Redis database id must be unique for everyone CMS and for different types of caching, in order to avoid errors with the intersection of data from different services.
Content