Summary
Add an optional Redis-backed JWKS key cache for the JWT middleware.
Context
The JWT middleware eagerly fetches JWKS keys at init and refreshes periodically. In multi-instance deployments, each instance independently fetches from the JWKS endpoint. A shared Redis cache reduces external calls and improves startup time for new instances.
Scope
- Implement
RedisKeyCache that stores fetched JWKS responses in Redis with TTL
- On JWKS refresh: check Redis first, fetch from endpoint only on miss
- On JWKS fetch: write to Redis with configurable TTL
- Key: configurable (default:
jwks:<endpoint_hash>)
- Use celeris's native Redis driver
- Optional — JWT middleware works without it (falls back to direct fetch)
Summary
Add an optional Redis-backed JWKS key cache for the JWT middleware.
Context
The JWT middleware eagerly fetches JWKS keys at init and refreshes periodically. In multi-instance deployments, each instance independently fetches from the JWKS endpoint. A shared Redis cache reduces external calls and improves startup time for new instances.
Scope
RedisKeyCachethat stores fetched JWKS responses in Redis with TTLjwks:<endpoint_hash>)