Event-driven invalidation.
also: event-based invalidation · event driven invalidationPublishing a change event when data is written, and having consumers delete or refresh the affected cache keys.
the two-minute refresher
- Write path: update the DB → publish product.updated → the invalidator deletes product:123.
- Staleness drops to the event's propagation delay instead of the TTL.
- Events can be lost or delayed: keep a TTL as a safety net.
- Publish reliably (outbox or CDC), or the cache silently goes stale.