Redis Caching

Configure Redis for session storage and caching.

Why Use Redis?

  • Session storage - Share sessions across multiple Authority instances

  • Token caching - Faster token validation

  • Rate limiting - Distributed rate limit counters

Prerequisites

  • Redis 6.0+

  • Network access between Authority and Redis

Basic Setup

Install Redis

Docker:

docker run -d -p 6379:6379 redis:7-alpine

macOS:

brew install redis
brew services start redis

Ubuntu:

Configure Authority

Set the Redis URL:

With password:

With database number:

Production Configuration

Redis Configuration

TLS/SSL

Docker Compose

High Availability

Redis Sentinel

Redis Cluster

Session Storage

With Redis enabled, sessions are stored in Redis instead of PostgreSQL:

Session expiry is handled automatically by Redis TTL.

Token Caching

Access tokens are cached for faster validation:

Rate Limiting

Rate limit counters use Redis:

Monitoring

Redis CLI

Check Connection

Troubleshooting

Connection refused

Check Redis is running:

Authentication failed

Verify password:

Memory full

Check memory usage:

Increase maxmemory or use eviction policy.

Next Steps

Last updated

Was this helpful?