01Chapter 1: What a cache is and when it pays offThis chapter assumes you can read basic Python, know how a client sends requests to a server that queries a database, and understand latency (time for one request) and throughput (requests handled per second).2 min read
02Chapter 2: The layers where caching happensThis chapter assumes you know how a client sends a request to a server, how a database answers queries, and what latency means. It maps the places where a cache can sit between a user and the data. Later chapters cover the patterns used inside each place.2 min read
03Chapter 3: Designing cache keysThis chapter assumes you know what a cache is, what a hit and a miss are, and how to read basic Python. A cache key is the string or value that identifies one cached entry. A poor key design causes wrong answers, not only wasted memory.2 min read
04Chapter 4: Cache-aside: the default read patternThis chapter assumes you know basic Python, how an application talks to a database, and what hit ratio means from the cache fundamentals chapter.2 min read
05Chapter 5: Read-through cachingThis chapter assumes you know the cache-aside pattern from the previous chapter, and that you are comfortable with hits, misses, and TTL. Read-through caching changes who is responsible for loading data on a miss.2 min read
06Chapter 6: Write-through cachingThis chapter assumes you know cache-aside, TTL, and basic database reads and writes. Write-through is a write pattern. Every write goes to the cache and to the database as part of the same operation, so the cache always holds the latest value for any key that was written.1 min read
07Chapter 7: Write-around cachingThis chapter assumes you know cache-aside (reads check the cache, then the database, and fill the cache on a miss), basic TTL behavior, and how a database write differs from a cache write.2 min read
08Chapter 8: Write-back cachingThis chapter assumes you know cache-aside and write-through, and that you understand why a database write costs far more than a memory write.2 min read
09Chapter 9: Expiring entries with TTLThis chapter assumes you know the cache-aside pattern from the previous chapters. You should also be comfortable with Python and with the idea of a cache hit and a miss.2 min read
10Chapter 10: Eviction policies: LRU, LFU, and FIFOThis chapter assumes you know what a cache is, how hits and misses work, and basic Python. A cache has limited space. When it is full and a new entry arrives, an eviction policy decides which existing entry to remove. A good policy removes entries you are least likely to need again, which keeps the 2 min read
11Chapter 11: Invalidating cached dataThis chapter assumes you know cache-aside, TTL expiration, and the basic read and write paths from earlier chapters. Invalidation is the work of removing or replacing a cached entry once its source data has changed. TTL alone bounds staleness. Invalidation shrinks it.2 min read
12Chapter 12: Consistency and staleness trade-offsThis chapter assumes you know cache-aside, TTL expiration, and invalidation from earlier chapters. It covers what a cache costs you in correctness and how to decide how much staleness you can accept.2 min read
13Chapter 13: Preventing cache stampedesThis chapter assumes you know cache-aside reads, TTL expiration, and basic threading in Python. A cache stampede is a burst of identical rebuilds that hits your database when a popular entry disappears.2 min read
14Chapter 14: HTTP caching and validationThis chapter assumes you know what a cache hit and miss are, how TTL expiration works, and the basics of HTTP requests and response headers. HTTP caching applies those ideas to browsers, CDNs, and proxies. The server describes how long a response stays fresh, and caches along the path follow those r2 min read
15Chapter 15: Distributed caches and consistent hashingThis chapter assumes you know cache-aside, eviction policies such as LRU, and basic client-server networking. It explains how a cache spreads across several nodes and why the way keys map to nodes matters.2 min read
16Chapter 16: Measuring cache effectivenessThis chapter assumes you know how cache-aside works, what a TTL is, and how eviction policies like LRU behave. It covers how to tell whether a cache is helping and where to look when it is not.2 min read
17Chapter 17: Choosing a strategy for your workloadThis chapter assumes you know the basic patterns (cache-aside, read-through, write-through, write-back, write-around), TTL, eviction, and invalidation from earlier chapters. It shows how to pick among them for a real workload.2 min read