A complex research assistant uses a 6,000-token system prompt that includes detailed domain expertise, output formatting rules, and 12 few-shot examples. The team wants to add more few-shot examples but is approaching the practical limit before context compression hurts performance. Where should cache_control breakpoints be placed to maximize savings on repeated calls?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because a two-tier cache hierarchy leverages the fact that different parts of the system prompt have different update frequencies. Domain expertise and formatting rules rarely change; few-shot examples may be updated periodically.
Full explanation below image
Full Explanation
B is correct because a two-tier cache hierarchy leverages the fact that different parts of the system prompt have different update frequencies. Domain expertise and formatting rules rarely change; few-shot examples may be updated periodically. The first breakpoint caches the deepest stable prefix (expertise + formatting). The second breakpoint caches the less-stable but still-repeated few-shot examples. When examples are updated, the first tier still hits, saving the cost of the stable prefix. When nothing changes, both tiers hit. A is wrong because placing a single breakpoint at the end of the entire system prompt works only when all content is equally stable; it misses the opportunity to recover partial cache savings when the few-shot examples are updated. C is wrong because placing breakpoints before each individual example is impractical (12 breakpoints approaches the API limit on simultaneous cache breakpoints) and the granularity provides little additional savings over option B. D is wrong because domain expertise and formatting rules are also stable and potentially long; excluding them from caching leaves savings on the table.