@lunro/cache
v0.5.1
Published
Redis-backed cache layer for the Lunro platform.
Readme
@lunro/cache
Redis-backed cache layer for the Lunro platform.
Fail-open by design: if Redis is disabled or unreachable, every cache wrapper degrades to a no-op and the pipeline runs at no-cache speed.
Configuration
Connection is resolved from the environment, REDIS_URL taking precedence:
| Variable | Default | Notes |
| -------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| REDIS_URL | — | Full connection string: redis://[user:pass@]host:port or rediss://… for TLS. Preferred for managed providers (Redis Cloud, Upstash, Railway). |
| REDIS_HOST | localhost | Used only when REDIS_URL is unset. |
| REDIS_PORT | 6379 | " |
| REDIS_USERNAME | — | " |
| REDIS_PASSWORD | — | " |
| REDIS_TLS | false | Set true to enable TLS in the discrete-var form. |
| REDIS_CONNECT_TIMEOUT_MS | 5000 | Bounded connect time before degrading to no-op. |
| CACHE_DISABLED | false | true skips Redis entirely (no-op cache). |
| CACHE_ARTICLE_TTL | 604800 | Per-cache TTL overrides, in seconds. |
| CACHE_LISTING_TTL | 600 | " |
| CACHE_SUMMARY_TTL | 2592000 | " |
