Mutex on refresh, jitter on TTL, stale-while-revalidate.
Killing the herd
Single-flight / mutex
In Redis:
SET lock:key 1 NX EX 10. Winner refills, others wait or serve stale.Jitter TTL
If TTL is 60s, use 60 ± 6s. Spreads expiry across 12 seconds.
Stale-while-revalidate
Serve stale for up to 5 minutes while refreshing. Users never wait.
Warm cache before expiry
Cron every 30s re-fills known hot keys before they expire.
Backpressure
Limit concurrent origin queries via a semaphore. Reject excess.
Never broadcast
Push invalidation sends "revalidate", not "evict". Let the cache refill on next read.