v1.1.0 Redis!
v1.1.0 — Redis caching layer
This release adds an optional Redis-backed caching layer that reduces redundant
PostgreSQL reads for read-heavy, slow-changing endpoints.
What's new
- Redis cache layer (
internal/cache) — aCachedReaderwraps the database
store and transparently caches responses using a genericgetOrSethelper with
graceful degradation. If Redis is unavailable, all reads fall through to
PostgreSQL with no impact on availability. - Explicit cache invalidation — node and observer cache entries are
invalidated immediately on upsert from the ingest path, keeping detail
responses accurate despite caching. - TTL-based expiry for stats and reference data, with a per-category
override system and a global fallback. Defaults to 1h, aligned with the
materialized view refresh cycle. - Fully optional — set
REDIS_ADDRto enable. Unset, Beacon behaves
exactly as before.
Configuration
Add to .env:
REDIS_ADDR=localhost:6379
REDIS_PASSWORD=
REDIS_DB=0Add to config.yaml (all optional, defaults to 1h):
cache:
ttl: "1h"
ttls:
stats: "1h"
reference: "1h"
nodes: "1h"
observers: "1h"