Cem
How do I prevent a Redis cache stampede (thundering herd) — mutex lock or XFetch?
A single-flight lock plus TTL jitter covers most cases; reach for XFetch only when recompute is truly expensive, and add stale-while-revalidate either way.
Tag
Cache layers, key design and invalidation — the second one being the hard part.
2 answered questions carry this tag.
A single-flight lock plus TTL jitter covers most cases; reach for XFetch only when recompute is truly expensive, and add stale-while-revalidate either way.
The moment a price changes, write through to KV or purge the key in the same transaction or outbox; a short TTL and versioned keys are only the safety net.