Keep the part that every request must read.
Before generating a response, a model processes its input: system instructions, tool definitions, conversation context, and the latest message. Processing those tokens creates intermediate attention state. If another request begins with the same prefix and the service can find a matching cache entry, it can reuse that state instead of calculating it again.
The prefix has to match according to the model provider or runtime’s rules. New content after the shared portion is still processed for the current request. Prompt caching can reduce repeated input work and, depending on the service, input cost or the time before generation starts. It does not remove the need to generate a new answer.
Short version: prompt caching carries forward computation for a matching prefix. It does not make the model remember an earlier conversation by itself.
The cached state is closely related to the key-value state used by a KV cache ↗. The difference is the reuse scope: a typical KV cache serves one active sequence, while prefix caching lets a runtime reuse eligible state across requests.
