What is prompt caching?

Definition

Prompt caching lets a serving system retain reusable state associated with input it has already processed. Repeated instructions or document context can then require less processing when the cache's matching and compatibility conditions are met.

The benefit depends on input stability, cache availability and the provider's implementation. It is separate from returning a stored final answer, and new content still requires computation. Cache boundaries and data-handling rules also matter when prompts contain sensitive information.

ELI5

Prompt caching is a shortcut that lets an AI service reuse work it recently did on the same starting information. It can make repeated requests faster or cheaper when a large unchanged prompt is sent again.

For example, several coding requests may share the same long project instructions. A provider might cache that common beginning, but a new session or changed model may lose the shortcut, so the important instructions still need to be available in full.

Is prompt caching the same as saving an answer?

No. It reuses work on the input context, while a response cache may return a previously stored output.

Why can changing a prompt reduce cache benefits?

The revised content may no longer match the state that was retained, depending on the service's matching rules.

  1. A flat attention-blue cache-to-code arrow on a black background beside the headline ‘GLM-5.3 WORKFLOW’.
  2. Nathaniel Whittemore beside the headline Fable 5.1 Earns Its Place
  3. A flat attention-blue terminal agent beside the headline DeepSeek Native Coder on a black background.
  4. Louis-François Bouchard, Omar Solano and Samridhi Vaid comparing cached conversation history, compaction and retrieval for an AI tutor.
  5. Byung-Gon Chun in a blue sweater gestures beside the blue and white headline FASTER AI AGENTS on black.
  6. Kevin Walmsley gestures beside the blue and white headline Model Cost Competition against a black background.
  7. Mingsheng Hong beside the headline Measure Value Not Tokens in attention blue and white
  8. A flat attention-blue coding terminal beside the headline $1 DeepSeek Coder on a black background.
  9. Theo Browne in blue points toward the viewer beside the blue-and-white headline “SOL FIGHTS BACK” on black.
  10. Portrait of Nate B. Jones beside the words Route Work by Risk
Definition card for prompt caching: What is prompt caching?

Prompt caching reuses compatible computation from previously processed prompt content to reduce repeated model-input work.