Cache invalidation — memastikan data yang di-cache konsisten dengan sumber kebenaran (source of truth) — terkenal sebagai salah satu masalah paling sukar dalam pengkomputeran. Cabarannya ialah memastikan cache tidak menyajikan data lapuk (stale) sambil mengimbangi prestasi, konsistensi, dan kerumitan. Beberapa strategi dan perangkap wajar difahami.
Masalah teras
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.
