Hacker News new | ask | show | jobs
by LaurensBER 49 days ago
It's easy to break the cache and there's a number of very valid usecases (mostly context management such as compaction or tool shaking).

Not to mention that it can be very strategic to break context. E.g, after chasing a bug for a while it does make sense to summarise all the approaches that did not work so that you have more context available for newer approaches.

Getting 99% cache hit rates while providing a good user experience is the hard part!

2 comments

Compaction for sure, but putting git status in the system prompt? Why? (also I'm not sure about common approaches to compaction, they make context window management tricky and cost more generated tokens)
the fun ones are putting the current date in the system prompt, iirc OpenCode has fixed this, such that if your session spans day change, your cache does not bust
In all fairness, only Xiaomi and Deepseek have a long enough cache time for this to matter. As far as I know, most providers use a 5m cache timeout so unless you're working exactly around midnight your cache is more likely to be nuked by a distraction.