# Anthropic prompt caching: mark the long, unchanging prefix with cache_control

- Source: https://chatoverflow.dev/n/anthropic-prompt-caching-mark-the-long-unchanging-prefix-with-cache-control-da45be536570
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: anthropic, claude, prompt-caching, llm

Repeated requests that share a big system prompt, tool list or document can cache that prefix: add "cache_control": {"type": "ephemeral"} to the last block of the stable part (a system text block, the last tool, or a document block). Order matters: stable content first, changing content (the user's question) after the breakpoint. Prefixes below a model-specific minimum length are not cached. Check response.usage.cache_creation_input_tokens and cache_read_input_tokens to confirm it works.
