The Thundering Herd on Cache Invalidation: Stale-While-Revalidate vs Probabilistic Early Expiration (XFetch)
When a hot cache key expires under heavy traffic, thousands of concurrent requests miss at the exact same millisecond and attempt to recompute the same expensive value, crushing the database. We compared distributed locking, Stale-While-Revalidate, and probabilistic early expiration (XFetch) to solve the cache stampede.