Redis
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.
Installation and Configuration
Using Docker
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.
Redis
To set up Redis via Docker, follow these steps:
- Download the
docker-compose.yaml
file for Redis available here. - Navigate to the directory where the file was downloaded and run the command:
- The Redis instance will be available at
localhost
on port6379
.
Environment Variables Configuration
After setting up Redis, define the following environment variables in your .env
file:
Local Installation
If you prefer to set up Redis locally without using Docker, follow the instructions below:
Redis
- Install Redis on your machine. On Ubuntu-based systems, for example, you can use:
- Start the Redis service:
- Verify that Redis is running correctly with the command:
If everything is working correctly, you will see the response PONG
.
Cache Configuration in Evolution API v2
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.