SkillSprout
Chapter 12

Caching

Caching keeps a copy of data in a place that is faster or closer than the original source, so repeated requests are answered quickly and the source is protected. This chapter covers what a cache is, how read and write strategies work, how caches decide what to evict, and why stale data and stampedes are the hard parts.

1What Is Caching?
Beginner
4 min
2Caching Strategies and Eviction
Beginner
3 min
3Invalidation and Cache Stampede
Intermediate
3 min

Chapter quiz

Caching · 5 questions

  1. 1.What is the main purpose of a cache?

  2. 2.How is hit ratio calculated?

  3. 3.Which write strategy risks losing data if the cache crashes?

  4. 4.Which policy evicts the entry unused for the longest time?

  5. 5.What is a cache stampede?

0 of 5 answered