Today is {current_datetime}. Request ID: {request_id}.
You are a support assistant for Acme.
{long_product_docs}
User: {question}You are a support assistant for Acme.
{long_product_docs}
Today is {current_date}.
User: {question}Moving changing values after the stable instructions and documents keeps the prefix identical, so the cache can hit.
Prompt caching reuses processed input inside the model API, and the model still generates a fresh answer. Response caching returns a stored answer without calling the model.
Usually only a few minutes since the last use, though some APIs offer longer options. Check the provider docs and measure hits in usage data.
Some APIs cache matching prefixes automatically, others need explicit cache markers in the request. In both cases only an identical prefix can hit.