Node.js · Senior · Question 39 of 75
What is a cache stampede, and how can you prevent it?
- ✓Correct answer: Many requests miss an expired hot key at once and all hit the database; prevent it with request coalescing, locks or early refresh
- 2Clients caching too long; prevent it with
no-store - 3A cache that grows too large; prevent it with compression
Explanation
Coalescing inside one process means sharing one in-flight promise per key. Across instances use a short lock in Redis or stale-while-revalidate.