Prefix caching stores the key and value tensors that the model computes during prefill, then loads them for a new request whose opening tokens match exactly. The serving engine finds the longest cached token sequence that matches from the start and runs prefill only for the remainder (Modular's inference handbook). vLLM implements this with a hash chain over token blocks, where each block hash includes the parent hash and the block's own tokens, so a change anywhere earlier in the prompt invalidates every block after it (vLLM docs).
That mechanics has one hard consequence: the match is exact, including whitespace and formatting. Two prompts that mean the same thing but start with different words are two different prefixes, and the second gets no reuse (Modular). It is also why prefix caching is correctness-neutral in principle: the reused tensors are mathematically identical to what a fresh prefill would produce. vLLM's documentation describes prefix caching as "almost a free lunch" that won't change model outputs (vLLM).
The risk enters from outside the model. The cache does not know that the policy paragraph it holds has been superseded, or that the price list embedded in the system prompt changed at midnight. It returns the same tensors it computed before, and the model reasons confidently from stale text. Cache correctness is therefore an application responsibility: you decide what goes in the cached region, and you decide when that region dies.
The size of the prize explains why teams take the risk. Provider prompt caching discounts cached reads heavily (Anthropic prices cache reads far below base input, and OpenAI applies a 50% discount on cached tokens), and the infrastructure effect is large: one production report measured time to first token dropping from 4.3 seconds to 0.6 seconds on a roughly 10,000 token prompt served from cache (llm-d). A team that has cut agent costs by 59% through caching (ProjectDiscovery) has a strong incentive not to break that prefix, and an equally strong incentive to hide the break rather than fix the cause.



