A library catalog assistant repeats a large static collection-policy preamble on almost every call. How should developers optimize?
Select an answer to reveal the explanation.
Short Explanation
That policy preamble is a library stamp you reuse all day. Cache it so you're not reprinting the whole handbook every checkout.
Full Explanation
Library catalog assistants that resend a large static collection-policy preamble on nearly every call should use prompt caching for that stable block. Prompt caching is correct because unchanged civic policy text can be reused across Messages API calls, cutting input tokens, latency, and cost while keeping the same grounding preamble available to the model. Conceptually this is configuration hygiene for municipal library systems: policy handbooks change rarely relative to chat volume, so paying full price every call is waste.
Applying prompt caching to the dynamic user query portion fails because the query changes with nearly every call, leaving little stable content to reuse; caching the volatile query instead of the static preamble misses the savings the stem asks for. Moving the collection-policy preamble to the end of user message content fails because prompt caching works best on a stable prefix, and placing the static block after dynamic content or at the tail of each message prevents effective reuse across calls. Increasing max tokens to allow resending the full preamble per call fails because it still retransmits the entire static block every time, forgoing the caching optimization and inflating spend without solving the underlying waste.
Exam caveat: prompt-caching questions target large static prefixes; increasing max tokens to resend the full preamble per call is not caching and still pays full price. Keep library collection-policy framing. Operational check: mark the static policy preamble as cacheable, verify cache hits on repeated catalog calls, re-invalidate when policy revisions publish, and compare token cost before/after caching.