Skip to the document
Madhuopen lab
Outcome School · Other AI topics17 min read

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.

3,340 words#llm#ai#system-design4 recall cards

How does Prompt Caching work?
Read on Outcome School ↗then come back to lock it in
Before you read, guess

What 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

  1. What is a prompt
  2. A quick recap of how an LLM reads a prompt
  3. What is Prompt Caching
  4. Why we need Prompt Caching
  5. The core idea behind Prompt Caching
  6. The exact-prefix rule
  7. Cache write vs cache read and TTL
  8. What we should put in the cache
  9. The benefits of Prompt Caching
  10. 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.

Before you go

In one sentence, what was this chapter about?

From memory, without scrolling up. Writing it is what makes it yours; the grade is only to show you what you had.

How sure?