Skip to content

Redis cache

Switch CACHE_PROVIDER to Redis and configure REDIS_* variables.

1 min read

Overview

By default the backend uses an in-memory cache (CACHE_PROVIDER=memory). For production (or multi-instance deployments), configure Redis and set CACHE_PROVIDER to redis.

Steps

Create a Redis database

If you don’t have Redis already, you can create one via Redis Cloud (or your preferred provider).

Once the database is ready, open your provider’s configuration/settings page and collect:

DetailWhere to find it
HostPublic endpoint, the hostname portion (e.g. redis-*****18904.*.ap-southeast-1-1.ec2.cloud.redislabs.com)
PortPublic endpoint, the port number after : (e.g. 18903)
PasswordDatabase Security section (often “Default user password”)

Set the backend env variables

Edit backend/.env.development.local (or your production env) and set:

CACHE_PROVIDER=redis
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
REDIS_DB=0
REDIS_PREFIX=app:cache:

Verify the connection

Start the backend and look for a Redis “connected” log line. If you see connection failures, re-check host/port/password.