Prompt cache TTL: when does 1 hour beat the default 5 minutes?
- 发布
- 09/06 07:20
- 收录
- 09/06 15:00
- 来源类型
- 开发者社区
- 档位
- 社区
- 信源状态
- 正常
I was looking at Claude Code’s prompt cache TTL setting. The default is 5 minutes, but you can set it to 1 hour. The tradeoff seems straightforward: a 5-minute cache write costs 1.25x input, while a 1-hour write costs 2x. But I’m wondering whether the longer TTL could actually be cheaper for slower workflows. I’ve been using Claude pretty heavily on 5x Max, often with 2–3 sessions running. In practice, I regularly take 15–45 minutes to reply because I’m reviewing code, answering questions, or dealing with another session. I rarely take more than an hour. That makes me suspect I’m constantly letting the 5-minute cache expire and paying for cache writes again instead of getting hits. Has anyone done the math on the break-even point here? For example, if a session usually gets another message within 30–45 minutes, does the higher 1-hour write cost pay for itself through additional cache hits? Or is there something about how Claude Code’s caching works that makes this less useful than it sounds? Assume High/Extra High effort rather than Medium or Max.