Redis & Caching
Configure Redis for caching and improved performance.
Tzylo Auth CE uses caching to improve performance and reduce repeated database access.
Redis is optional but recommended for production environments.
Why caching is used
Authentication systems frequently perform repeated lookups for:
- OTP verification
- Rate limiting counters
Caching reduces database load and improves response times for these operations.
How Redis is used
When Redis is configured, Tzylo Auth CE uses it for:
- OTP storage and validation
- Rate limiting state
Enabling Redis
To enable Redis, set the following environment variable:
Redis configuration
REDIS_URL=redis://localhost:6379No additional configuration is required.
Connection retries
Redis connection retry behavior can be controlled using:
Retry configuration
REDIS_MAX_RETRIES=1A low retry count prevents long startup delays when Redis is unavailable.
Running without Redis
If REDIS_URL is not set, Tzylo Auth CE automatically falls back to in-memory caching.
In-memory caching is suitable for local development and single-instance deployments, but not recommended for horizontally scaled production systems.
Production guidelines
- Use Redis in production environments
- Run Redis as a managed service when possible
- Avoid sharing Redis between unrelated workloads