Redis is used by Evolution API v2 as a caching system to optimize the application’s performance and speed. It can be configured to store temporary information and improve operational efficiency.
The easiest and fastest way to set up Redis for Evolution API v2 is through Docker. Below are the instructions to configure Redis using Docker Compose.
After setting up Redis, define the following environment variables in your .env file:
Copy
# Enable Redis cacheCACHE_REDIS_ENABLED=true# Redis connection URICACHE_REDIS_URI=redis://localhost:6379/6# Prefix to differentiate data from different installations using the same RedisCACHE_REDIS_PREFIX_KEY=evolution# Enable to save connection information in Redis instead of the databaseCACHE_REDIS_SAVE_INSTANCES=false# Enable local cacheCACHE_LOCAL_ENABLED=false
After installing and configuring Redis, the next step is to configure caching in Evolution API v2 using environment variables. This will enable the API to use Redis to cache important data and improve the overall performance of the application.