by Amit Shekhar · 9 June 2026
How does Prompt Caching work?
How Prompt Caching works. We will also see why we need it, how it actually works inside a large language model, and where it is used in real systems like AI assistants and agents.
Read on Outcome School ↗then come back to lock it in
Before you read, guessWhat computational process occurs for each token when constructing the KV cache for a lengthy prompt?
Ten seconds, a guess, then read — a wrong guess still makes the answer stick.
What this article covers
- What is a prompt
- A quick recap of how an LLM reads a prompt
- What is Prompt Caching
- Why we need Prompt Caching
- The core idea behind Prompt Caching
- The exact-prefix rule
- Cache write vs cache read and TTL
- What we should put in the cache
- The benefits of Prompt Caching
- Prompt Caching in the real world
The article lives on outcomeschool.com. Read it there, then come back: the tutor in the margin has read it and will answer questions, and the questions below check what stayed.
