What got me here was not the 0% hit rate itself. It was how plausible the failure mode is. Prompt caching sounds like the kind of feature that should be hard to misuse, but this article is a pretty good reminder that “silent miss” is exactly the sort of behavior that makes infrastructure bugs expensive. If the API had yelled, this would have been a two-minute fix. Instead it happily charged full price while pretending to help.
The timestamp bug is the one I’d expect people to trip over first. Putting datetime.now() at the start of a cached system prompt is such a small, natural mistake that it almost feels unfair. You can absolutely see a developer thinking, “The interviewer should know the time,” and not realizing they’ve just invalidated the entire prefix. That part checks out.
The set-ordering bug is more interesting to me because it’s the kind of thing that only shows up once you have multiple workers and enough traffic to notice a pattern. I like that the author actually did the math and got a hit rate that lined up with the prediction. That makes the story feel more real, not less. The uncomfortable lesson is that “works in one process” is not the same as “stable across production.” Python bites people here all the time, and prompt caching just gives the bug a much more expensive stage.
The shortest prompt issue is the one I’d want to verify against the docs myself. I’m not saying it’s wrong, but I’d be cautious about assuming every model behaves exactly the same way or that the threshold is the same in every setup. Still, the broader point is believable: if cache creation quietly returns zero, and you only look at reads, you can fool yourself into thinking the system is optimized when it isn’t.
What I actually take away is less “here’s how Claude caching works” and more “treat caching like a contract, not a hint.” Stable prefix, deterministic ordering, no volatile data before the breakpoint, and logging that exposes reads and writes on every response. That last bit is the real fix. Without it, you’re just hoping the cost graph tells you the truth later.
Reference: Claude Prompt Caching Hit 0 of 1,412 Calls: A Timestamp Killed It