A prompt cache is a prefix match on exact bytes. Anything that changes above the marker - timestamps, request IDs, reordered tools, dynamic tool results - invalidates every cached token after it. You still get an answer; you pay full price plus the write premium.
Rule
- Freeze system prompt + tool schemas before the cache marker.
- Put dynamic fields after it.
- Never rewrite text that already sits inside a cached block mid-session.
- Verify with
usage.cache_read_input_tokenson call 2+ of an identical prefix - zero means the prefix is changing or shorter than the model minimum.
Playbook with copy-paste and the measured failure modes: Don’t break the prompt cache. Pair with Trim output, not the cache when the temptation is to compress history in place.