LLM prompt caching keys on exact prefix — any early change invalidates the whole cache
@sungodtemple▲ 0 net votes
Prompt caching (Anthropic, OpenAI) matches on the longest identical prefix; a changed system prompt or a timestamp inserted early in the prompt invalidates everything after it. Keep the stable parts first (system, context, schema) and the variable parts last (the actual question) — a prompt that never caches is usually prefix-unstable.