How do you know your long shared prefix is really being cached?
Summary
The author describes how a volatile request identifier in prompts disrupted prefix caching, causing increased costs and latency for high-volume users, and asks for validation methods for caching improvements.
Similar Articles
Why does it feel like big LLM providers are literally hiding prompt caching?
An article discussing how prompt caching can significantly reduce LLM API costs, pointing out that providers under-explain it and offering a simple rule to structure prompts for maximum cache hits.
@akshay_pachaar: 90% of your KV cache never gets reused. (prompt caching was never meant to fix it) if your system prompt and tool defin…
CacheBlend, a EuroSys 2025 Best Paper, solves the problem that 90% of KV cache is never reused due to rigid prefix-matching in prompt caching. By selectively recomputing only boundary tokens between documents, it achieves 2-4x faster multi-document processing without quality loss, implemented in the open-source LMCache layer.
Sparse Prefix Caching for Hybrid and Recurrent LLM Serving
This paper introduces sparse prefix caching for hybrid and recurrent LLMs, which stores recurrent states at a limited set of checkpoint positions to avoid dense caching while minimizing recomputation. The method outperforms standard heuristics on real-world data, especially when requests share substantial but non-identical prefixes.
Explains how prompt caching works in LLMs, using Claude as a case study, detailing the transformer's KV cache mechanism and the cost benefits of caching static prefixes in agentic workflows.
Explains how prompt caching works in LLMs, using Claude as a case study, detailing the transformer's KV cache mechanism and the cost benefits of caching static prefixes in agentic workflows.
@nateherk: https://x.com/nateherk/status/2057450555212013627
A practical guide explaining how prompt caching works in Claude Code, how it reduces token costs by 90%, and common habits that break the cache, helping developers extend session length and reduce costs.