AI Dojo Open on the typewriterThe typewriter

Explainer

Prompt caching

2 min read
Assumes: you know what a reply costs.
First published 19 November 2026. Last edited 21 November 2026.

Reusing the work already done on the start of a prompt, so a later request that begins with exactly the same tokens can skip it.

Illustration, with an invented size: a library assistant on a hosted service sends the same 2,500 tokens of instructions and notice before every patron's question. (The 990-token system part in Debug one training row is a separate illustration of one training row, not this live service.) The first request processes all of it. A later request that starts with identical tokens reuses that work and processes only the new question, so its first token arrives sooner and its input costs less. The answer is still written fresh. The match must be exact from the first token; OpenAI's caching guide says “Cache reuse requires the entire rendered prefix to match.” Put fixed material first and anything that changes, such as today's date, at the end.

Three neighbours share the word “cache”:

  • The KV cache. Working memory inside one reply: the keys and values of earlier tokens, which the model keeps while it writes the next one. See KV cache.
  • Prefix caching. The same reuse inside a serving engine you run yourself, described in the inference read. A provider's prompt cache works this way too: it stores the model's calculations, not the text.
  • Semantic caching. An app hands back a stored answer when a new question looks similar to an old one. No new answer is written, so a near match can return the right answer to a different question. GPTCache's documentation warns of “false positives during cache hits”.
Going deeper

The rules change. On 19 November 2026, Anthropic's cache lasted five minutes by default; reading from it cost 0.1 times the base input price on most models, while writing to it cost more than ordinary input. OpenAI described cached input as “discounted up to 95%” and set a minimum cacheable prompt of 1,024 tokens on its newer models.

In the long read: Reuse the beginning, then write a new answer. Then read Tail latency and goodput.