Skip to content
AI & Automation

Prompt Caching: Is Repeating the Same Policy Text Worth Caching?

Caching can cut the cost of sending the same long instructions again and again, but only when requests arrive often enough and the repeated text is identical. Use a simple traffic test before asking for it.

One indigo stencil sits beside several request sleeves with matching openings and different colored inserts.

If every request your workflow sends begins with the same several pages of instructions or policy text, prompt caching lets the provider reuse that repeated opening instead of processing it from scratch each time. Whether that saves money depends almost entirely on how often requests arrive, so check your traffic pattern before asking anyone to turn it on.

How the mechanism works

Anthropic’s caching documentation explains that a cached prefix covers tool definitions first, then the system instructions, then the messages, up to a marked point. When a new request begins with an identical prefix, the system reuses it, lowering cost and delay; otherwise it processes the whole prompt and stores the prefix for later. Caching does not change the output. Cache hits require every part of the cached portion to match exactly, including text and images, so any change at or before the marked point causes a miss.

The numbers that decide it

Factor What the documentation says
Minimum length Shorter prompts are processed without caching and no error is raised; the minimum varies by model, from 512 to 4,096 tokens in the documented list
Default lifetime Five minutes, refreshed at no cost each time the cached content is used
Extended lifetime One hour, at a higher write cost
Write cost Five-minute writes cost 1.25 times the base input price; one-hour writes cost twice the base
Read cost A fraction of base input; the multiplier differs by model, so check the pricing page for yours

The read price is lower than normal input, and the write price is higher. So caching is a bet: you pay a premium once and win it back only if later requests actually read the stored copy before it expires.

The traffic test

Consider two hypothetical businesses using the same 5,000-token instruction block. All traffic figures are illustrative.

  • A restaurant’s order helper receives a burst of questions between 11:30 and 1:00, a few per minute. Each request refreshes the stored copy, so most requests after the first read it. Caching is likely to help.
  • A tax preparer’s after-hours assistant gets about four questions a day, spread across the evening. The gaps are longer than five minutes, so the copy has expired by the next question. Every request pays the write premium and none reads a hit. Caching would raise cost.

The documentation’s own list of when caching is not worthwhile makes the same point: requests that arrive less often than the lifetime, a marked section that changes every time (a timestamp or the incoming customer message), or a prompt below the minimum length. It also notes that parallel requests sent before the first response begins cannot read an entry that does not exist yet.

What breaks a cache you thought you had

  • Changing tool definitions invalidates everything.
  • Toggling web search or citations invalidates the system and message caches.
  • Changing the thinking configuration or effort setting invalidates the message cache.
  • Putting a changing item, like today’s date, ahead of the stable text means the cached portion never matches.

The practical design rule is to place stable material first (instructions, policy text, examples) and variable material last (the customer’s message).

How to verify it works

Each response reports usage fields for tokens written to the cache, tokens read from the cache and ordinary input tokens. If both the written and read counts are zero, the prompt was not cached, most likely because it fell below the minimum. Ask your integrator to share a day of these counts. A healthy pattern shows reads far exceeding writes. A pattern with writes on nearly every request means the cache is expiring or being invalidated, and you are paying the premium for nothing.

Rate limits are a second reason to care

The rate limits page notes that, for most Claude models, cached reads do not count toward the input-tokens-per-minute limit, while tokens written to the cache do. A busy workflow that hits throttling may gain headroom from caching even when the savings are modest. This is a throughput argument, separate from price; check it against your actual limits before relying on it.

Decision checklist

  1. Is the repeated opening longer than the model’s minimum?
  2. Is it identical across requests, with variable text moved to the end?
  3. Do requests normally arrive within five minutes of each other during active periods?
  4. If not, would a one-hour lifetime fit better, given its higher write cost?
  5. After enabling, do the usage counts show reads well above writes?

If any answer is no, leave caching off and spend the effort on shortening the prompt instead. Fewer tokens sent is a saving that never expires.

Sources