Question 24
Domain 3Which placement of `cache_control` *maximises* cache reuse for a system prompt of: [role definition] [10K product manual] [today's date] and a user message containing the question?
Correct answer: A
Explanation
Cache reuse is maximized when the longest stable prefix stays identical across requests, because caches match from the start of the prompt. Placing `cache_control` after the product manual but before today’s date keeps the "[role definition] [10K product manual]" portion reusable while isolating the changing date and user question, which vary more often.
Why each option is right or wrong
A. After the product manual but before today's date (i.e. between the manual and the date).
Prompt caches are prefix-based: reuse is determined by the longest identical leading token sequence, so the cache marker should be placed at the last point before any frequently changing content. Here, putting `cache_control` after the 10K manual but before today’s date preserves the entire role definition + manual block as the stable cached prefix, while excluding the date and user question, which are the parts most likely to differ between requests.
B. Before the role definition.
Marks too little reusable content, excluding the large stable product manual from the cached prefix.
C. After today's date but before the user message.
Includes today's date in the cached prefix, reducing reuse because that value changes frequently.
D. At the end of the user message.
Places the boundary after the user question, which is highly variable and defeats broad cache reuse.