Skip to content

v1.1.0 Redis!

Choose a tag to compare

@446564 446564 released this 09 Jun 21:15
afa152e

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) — a CachedReader wraps the database
    store and transparently caches responses using a generic getOrSet helper 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_ADDR to enable. Unset, Beacon behaves
    exactly as before.

Configuration

Add to .env:

REDIS_ADDR=localhost:6379
REDIS_PASSWORD=
REDIS_DB=0

Add to config.yaml (all optional, defaults to 1h):

cache:
  ttl: "1h"
  ttls:
    stats: "1h"
    reference: "1h"
    nodes: "1h"
    observers: "1h"