A timestamp at the top of every prompt tanks the cache hit rate — find the mistake
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Click any words you think contain an error. Click again to unmark.
Putting a per-request timestamp at the very front changes the first bytes of every prompt, so the exact-prefix cache never hits — move volatile content after the stable prefix.
Imagine a library where they pre-process a thick reference book once so anyone can look things up fast. But someone insists on writing today's date on the very first page before each reader opens it. Now the first page is different every time, so the librarian thinks it's a brand-new book and re-processes the whole thing from scratch. That's what's happening here. The cache reuses work only when the start of the prompt is exactly the same. A timestamp stamped at the top changes the start on every request, so nothing matches and the cache is useless. The fix isn't to drop the timestamp — it's to move it to the end, after the parts that never change.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Take 5-7 minutes to explain exact-prefix matching, why a leading timestamp forces a position-zero miss, and the stable to volatile reordering fix.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Concluding the cache is broken or disabled, when really a dynamic value at position zero changes the prefix every call so the exact-prefix match never fires.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.