01Chapter 1: Why processing a long prompt is expensivePrompt caching exists because reading a prompt costs real compute, and most applications make the model read the same text again and again. This chapter explains where that cost comes from. Later chapters cover what the provider stores to avoid it and how to get the savings.6 min read
02Chapter 2: What the provider actually stores: reusable attention stateThis chapter assumes you know what tokens and context windows are and can read short Python. You don't need to know transformer math in detail. The chapter explains the one piece you need: what a provider keeps between your requests when it "caches a prompt".6 min read
03Chapter 3: Why only an identical prefix can hitThis chapter assumes you have called an LLM API before, know what tokens and a context window are, and can read short Python snippets. It builds on the previous two chapters: processing a prompt (prefill) costs time and money, and the provider can store the attention state it computed for a prompt (7 min read
04Chapter 4: Explicit breakpoints and automatic cachingThis chapter assumes you can call an LLM API from Python and know what tokens are. It also assumes you know that a cache hit needs an identical prompt prefix, which the previous chapter covered. Here you will see how providers decide where a cached prefix ends. There are two designs: you mark the en5 min read
05Chapter 5: Laying out prompts: stable content first, variable content lastThis chapter assumes you have called an LLM API before, know what tokens and context windows are, and can read short Python. It also assumes you know the earlier idea in this tutorial: a cache hit needs an identical prompt prefix. Here you will use that rule to decide where each piece of a prompt be6 min read
06Chapter 6: How long a cache entry lives and what refreshes itThis chapter assumes you have read the earlier chapters on exact prefix matching and on explicit versus automatic caching. You should also be comfortable reading short Python snippets and thinking in terms of requests per minute. Provider numbers below (lifetimes, multipliers) are the published valu6 min read
07Chapter 7: Minimum prompt length for cachingThis chapter assumes you can call an LLM API, know what a token and a context window are, and can read short Python snippets. It also assumes you have read the earlier chapters on prefix matching and on explicit breakpoints versus automatic caching.6 min read
08Chapter 8: What caching changes in cost and latencyThis chapter assumes you know how prefix matching works from earlier chapters and can read short Python. It covers which parts of a request caching makes cheaper or faster, how to calculate the break-even point, and which costs stay the same.6 min read
09Chapter 9: Reading usage fields and computing a hit ratioThis chapter assumes you can call an LLM API from Python, know what tokens and context windows are, and have read the earlier chapters on prefix matching and breakpoints. Here you will learn to read the usage data that comes back with each response, turn it into a hit ratio, and use it to decide whe6 min read
10Chapter 10: Tools, system prompts and growing conversation historyThis chapter covers how the parts of a real request (tool definitions, system prompt, and a growing message list) fit into one cached prefix. It assumes you can call an LLM API, know what tokens and context windows are, and can read short Python snippets. It also assumes you know that a cache hit ne6 min read
11Chapter 11: Finding and fixing the changes that break your cacheThis chapter assumes you can read short Python snippets and that you know how exact prefix matching works. You should also know how to read the cache fields in a usage report (tokens written, read, and uncached). Here you will use those fields to find out why a cache that should hit is missing.6 min read
12Chapter 12: Parallel requests and warming the cacheThis chapter assumes you have read the earlier chapters on exact prefix matching, cache lifetime, and reading usage fields. You should be comfortable calling an LLM API from Python and reading short snippets that use threads or asyncio.8 min read
13Chapter 13: Routing hints and cache keys for high-volume trafficThis chapter covers what happens when one prompt prefix is sent many times per minute. It assumes you know exact prefix matching, cache lifetime, and how to read usage fields from earlier chapters. You should also be able to read short Python snippets.6 min read
14Chapter 14: Deciding when caching is worth itEarlier chapters covered how caching works and how to raise hit rates. This chapter covers whether caching is worth turning on for a given workload. It assumes you can read short Python snippets, know what tokens and context windows are, and have read the chapters on cache lifetime, minimum length, 6 min read