Cache invalidation — cached data को source of truth के साथ consistent रखना — कंप्यूटिंग में प्रसिद्ध रूप से सबसे कठिन समस्याओं में से एक है। चुनौती यह सुनिश्चित करना है कि caches stale data न परोसें, जबकि performance, consistency, और complexity के बीच संतुलन बनाएँ। कई strategies और pitfalls समझने योग्य हैं।
मूल समस्या
When the source data changes, the cached copy becomes STALE.
→ Serve stale data? (fast but wrong) vs invalidate? (consistent but complex/slower)
→ "There are only two hard things in CS: cache invalidation and naming things."
The difficulty: knowing WHEN and WHAT to invalidate, across distributed systems,
without races, while keeping good cache hit rates.
