passdrill
AI & LLM Engineering · Prompt Engineering · Card 024/024 easy

Anthropic's prompt caching documentation describes marking a "cache breakpoint" with the `cache_control` parameter. For a request that mixes stable content (tool definitions, a system prompt, a large reference document) with content that changes on every call (the current user turn), where should that breakpoint be placed, and why?

  1. On the very first token of the entire request, including the tool definitions, so that almost nothing in the request ends up covered by the cached prefix
  2. On the last content block whose prefix is identical across requests -- that is, after the stable tool definitions, system prompt, and document, and before the changing per-request content -- because the cache only stores what comes before the breakpoint, and placing it on content that changes every request would make the cached prefix's hash change each time, producing no cache hits
  3. On the changing user message itself, because caching is described as useful specifically for content that differs on every single call
  4. Nowhere -- Anthropic's API caches every request identically by default with no `cache_control` parameter or configuration needed
Next card → Shuffle