Skip to content

Prompt caching

Prompt caching is the temporary storage, at the model provider, of the fixed part at the start of a prompt, so that later calls continue from it instead of processing it again. In Anthropic, this part is marked with cache_control, and the cache is kept for 5 minutes by default and refreshed with each use. Only an identical prefix is cached, so a small change at the start of the prompt cancels the caching.

Source content checked . English translation published 2026-10-27.

In business automation

When the same long instruction is sent again and again at the start of every call to a model, the provider processes it again each time. Prompt caching temporarily stores this fixed part, and in Anthropic it is marked with cache_control. The cache is kept for 5 minutes by default and refreshed with each use, and only an identical prefix is cached.

Examples

These examples illustrate a possible workflow. Adapt the connections and rules to your own systems.

Fixed instructions at the start of every call

A service bot sends every inquiry the same long instructions about the business's tone and procedures, followed by the customer's message. The fixed instructions are marked for caching, and the customer's message stays outside the cached part because it changes with every inquiry.

A small change at the start of the prompt

Someone adds today's date to the first line of the prompt, and the cache stops helping. Because only an identical prefix is cached, a line that changes at the top of the prompt cancels the caching, so it is better to move changing details to the end of the message.

Relevant tools

Claude
The definition comes from Anthropic's documentation, where the part to cache is marked with cache_control.
Anthropic
According to Anthropic's documentation, the cache is kept for 5 minutes by default and refreshed with each use.

What to check

  • Putting a detail that changes with every call, such as a date or a customer name, at the start of the prompt. Only an identical prefix is cached, so a small change there cancels the caching.
  • Assuming the cache is kept without a time limit. The default in Anthropic is 5 minutes, and it is refreshed with each use.

Related terms

Sources