Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks
Elias Lumer, Faheem Nizar, Akshaya Jangiti, Kevin Frank, Anmol Gulati, Mandar Phadate, Vamse Kumar Subbiah
TL;DR
The paper evaluates prompt caching for long-horizon LLM agents across three major providers (OpenAI, Anthropic, Google) and four flagship models, using the DeepResearchBench benchmark to assess cost and latency. It compares three caching strategies—full context, system prompt only, and exclude tool results—against a no-cache baseline, employing UUID-based boundary control to isolate prefix reuse. Results show substantial cost savings (roughly 28–81% depending on model and strategy) and TTFT improvements (approximately 6–31%), with system-prompt-focused caching delivering the most consistent benefits. The authors argue that strategic cache boundary control, rather than naive full-context caching, yields reliable performance gains, and they offer practical guidance for deploying prompt caching in production agentic systems, including considerations for tool calls and provider-specific variability.
Abstract
Recent advancements in Large Language Model (LLM) agents have enabled complex multi-turn agentic tasks requiring extensive tool calling, where conversations can span dozens of API calls with increasingly large context windows. However, although major LLM providers offer prompt caching to reduce cost and latency, its benefits for agentic workloads remain underexplored in the research literature. To our knowledge, no prior work quantifies these cost savings or compares caching strategies for multi-turn agentic tasks. We present a comprehensive evaluation of prompt caching across three major LLM providers (OpenAI, Anthropic, and Google) and compare three caching strategies, including full context caching, system prompt only caching, and caching that excludes dynamic tool results. We evaluate on DeepResearchBench, a multi-turn agentic benchmark where agents autonomously execute real-world web search tool calls to answer complex research questions, measuring both API cost and time to first token (TTFT) across over 500 agent sessions with 10,000-token system prompts. Our results demonstrate that prompt caching reduces API costs by 45-80% and improves time to first token by 13-31% across providers. We find that strategic prompt cache block control, such as placing dynamic content at the end of the system prompt, avoiding dynamic traditional function calling, and excluding dynamic tool results, provides more consistent benefits than naive full-context caching, which can paradoxically increase latency. Our analysis reveals nuanced variations in caching behavior across providers, and we provide practical guidance for implementing prompt caching in production agentic systems.
