Set up Redis service
Redis is an optional, backend cache solution that replaces the Zend Framework Zend_Cache_Backend_File, which is used in Magento 2 by default.
We support Redis versions 3.2 and 5.0. See Configure Redis.
You can use the following instructions for service setup on Magento Commerce Cloud Pro Integration environments and Starter environments, including master
branch. You must submit a support ticket to configure the service on Pro Production and Staging environments. See Services.
To enable Redis:
- Add the required name and type to the
.magento/services.yaml
file.
1
2
myredis:
type: redis:<version>
To provide your own Redis configuration, add a core_config
key in your .magento/services.yaml
file:
1
2
cache:
type: redis:<version>
-
Configure the relationships in the
.magento.app.yaml
file.1 2 3 4 5 6
runtime: extensions: - redis relationships: redis: "redis:redis"
-
Add, commit, and push your code changes.
1
git add -A && git commit -m "Enable redis service" && git push origin <branch-name>
Using the Redis CLI
Assuming your Redis relationship is named redis
, you can access it using the redis-cli
tool.
-
Use SSH to connect to the Integration environment with Redis installed and configured.
-
Open an SSH tunnel to a host.
1
redis-cli -h redis.internal