Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Latest commit

 

History

History
75 lines (59 loc) · 2.39 KB

File metadata and controls

75 lines (59 loc) · 2.39 KB
id redis
title Redis
hide_title true
hide_table_of_contents false
sidebar_label Redis
sidebar_position 4
pagination_label Redis
description Setup an Redis in your environment with Evolution API.
keywords
Optional Resources
Redis
Database
last_update
date author
12/19/2023
matheus

Setup Redis Cache

Redis is an in-memory data structure store, used as a database, cache, and message broker. It supports data structures such as strings, hashes, lists, sets, and more. Incorporating Redis can significantly improve the performance of Evolution API by enabling faster data access and efficient caching. Its integration with the Evolution API enhances system responsiveness through:

  1. Caching Chatwoot Messages: Significantly improves message retrieval and response times.
  2. Instance Storage: (Deprecated) Previously used for managing API instances efficiently.

Configuring Redis for Evolution API

Docker Setup (Recommended)

For environments utilizing Docker, configure your Redis settings in the .env file:

CACHE_REDIS_ENABLED=true
CACHE_REDIS_URI=redis://localhost:6379
CACHE_REDIS_PREFIX_KEY=chatwoot-cache
CACHE_REDIS_TTL=604800
CACHE_LOCAL_ENABLED=true
CACHE_LOCAL_TTL=86400

PM2 Setup (test and development)

If you use PM2 installation method, the variables has to be set on env.yml:

CACHE:
  REDIS:
    ENABLED: true
    URI: "redis://localhost:6379"
    PREFIX_KEY: "evolution-cache"
    TTL: 604800
  LOCAL:
    ENABLED: true
    TTL: 86400

Deprecation Notice: Redis Instance Storage

:::info Deprecation of Redis for instances

Redis for saving instances will be deprecated in future versions of Evolution API, we do not recommend Redis installation anymore for instance management, there is some problems when using more than one instance.

:::

Set the Redis environment variables in the .env for Docker or the dev-env.yml for NPM file as follows:

Bug: with multiple instances Redis ends up mixing information of messages sometimes, this is why deprecation is planned in future versions.

REDIS_ENABLED=false
REDIS_URI=redis://redis:6379
REDIS_PREFIX_KEY=evo