# Prompt Caching

> Saving the work on a prompt's fixed start, so the next request reuses it.

**Field:** Artificial Intelligence  
**Category:** Working with AI  
**Also known as:** Context Caching, Prefix Caching

## Think of it like

Think of it like a teacher who keeps notes on a long book. Next time, they skip straight to the new question.

## Definition

Prompt caching saves the model's work on the start of a prompt, so the next request that starts the same way can reuse it. It helps when many requests share a long fixed part, like a system prompt, a manual or a codebase. The reused part is read much faster and billed at a lower price. The cache only lasts a short time, often minutes, and the start has to match exactly. Any change early in the prompt breaks the match for everything after it.

## Example

Lucy's bot sends the same 50-page manual with every question. With prompt caching, only the first request pays full price for the manual. The rest reuse it.

## Why it matters

For apps that resend a big fixed part, it can cut both cost and wait time a lot.

## Common mistake

Putting changing text, like the date, at the very start. The cache only matches up to the first change, so fixed parts must come first.

## Three principles

- **Reuse the fixed start.** Same start, less work.
- **Exact match.** One change breaks it.
- **Short-lived.** Often minutes.

## Related terms

- [KV Cache](https://learn.benibix.com/term/ai/kv-cache)
- [System Prompt](https://learn.benibix.com/term/ai/system-prompt)
- [Context Window](https://learn.benibix.com/term/ai/context-window)
- [Token (AI)](https://learn.benibix.com/term/ai/token)
- [Semantic Cache](https://learn.benibix.com/term/development/semantic-cache)

## Told apart from

- [Semantic Cache vs Prompt Caching](https://learn.benibix.com/compare/semantic-cache-vs-prompt-caching): People often think a semantic cache and prompt caching are the same money saving trick. A semantic cache skips the model and returns a saved answer. It does that when a new question means the same as an old one. Prompt caching still calls the model every time, but it reuses the work done on the start of a long prompt that has not changed.

## Taught in

- [Prompt Caching and Cost](https://learn.benibix.com/learn/ai-working-with-ai/prompt-caching-and-cost): Prompt Engineering, 11/16

![Two requests that start with the same long manual. In the first, the manual is worked out and saved. In the second, the manual is read from the cache and only the new question is worked out.](https://learn.benibix.com/diagrams/pr-prompt-caching.svg)

---

Source: https://learn.benibix.com/term/ai/prompt-caching
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
