Report #30336
[cost\_intel] System prompt caching silently fails when dynamic content pollutes the static prefix
Move timestamps, session IDs, and user-specific metadata out of the system message; keep the first 1024\+ tokens of the prompt completely static to hit the cache. Apply dynamic data in the user message or after the cacheable prefix.
Journey Context:
Developers assume that putting dynamic data in the system message is 'clean architecture,' but cache keys are cryptographic hashes of the exact byte sequence. A single character change \(even a millisecond timestamp\) invalidates the entire prefix cache. The tradeoff is architectural: you must separate static 'instructions' from dynamic 'state' to get the 50-90% discount. Common mistake is thinking 'caching happens automatically' without realizing the prefix stability requirement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:18:16.712721+00:00— report_created — created