# Faster Agents with Automatic Prompt Caching

DevFeed: [Faster Agents with Automatic Prompt Caching](<https://devfeed.tech/articles/faster-agents-with-automatic-prompt-caching-26402.md>)

Original publisher: [Read original article](<https://www.heroku.com/blog/faster-agents-automatic-prompt-caching/>)

Author: Anush DSouza

Published: 2025-12-04T16:00:24Z

Content type: article

Language: en

Sources: [Heroku](<https://devfeed.tech/sources/heroku.md>)

Topics: [Managed Inference and Agents](<https://devfeed.tech/topics/managed-inference-and-agents.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Heroku AI](<https://devfeed.tech/topics/heroku-ai.md>), [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [automatic](<https://devfeed.tech/tags/automatic.md>), [billing](<https://devfeed.tech/tags/billing.md>), [caching](<https://devfeed.tech/tags/caching.md>), [faster](<https://devfeed.tech/tags/faster.md>), [hashing](<https://devfeed.tech/tags/hashing.md>), [heroku](<https://devfeed.tech/tags/heroku.md>), [heroku-ai](<https://devfeed.tech/tags/heroku-ai.md>), [inference](<https://devfeed.tech/tags/inference.md>), [managed-inference-and-agents](<https://devfeed.tech/tags/managed-inference-and-agents.md>), [memory](<https://devfeed.tech/tags/memory.md>), [models](<https://devfeed.tech/tags/models.md>), [news](<https://devfeed.tech/tags/news.md>), [privacy](<https://devfeed.tech/tags/privacy.md>), [prompt-caching](<https://devfeed.tech/tags/prompt-caching.md>), [security](<https://devfeed.tech/tags/security.md>), [security-infrastructure](<https://devfeed.tech/tags/security-infrastructure.md>), [system-prompts](<https://devfeed.tech/tags/system-prompts.md>), [token](<https://devfeed.tech/tags/token.md>)

## AI overview

Heroku's automatic prompt caching reuses processed system prompts and tool definitions to speed up repeated agent requests, while leaving user messages and conversation history uncached. It is enabled by default for Heroku Managed Inference and Agents; caching applies only when content meets a minimum token threshold, and the cache expires after five minutes of inactivity. Heroku says cached content stays in secure memory, protected with cryptographic hashing, and is not stored persistently. Cache writes are currently free, with no cache-hit price difference passed on while Heroku evaluates the system. Behavior and thresholds vary by model; the excerpt does not provide the thresholds or the setting used to disable caching.

## Source excerpt

Since its launch, automatic prompt caching has been delivering a notable, zero-effort performance increase for Heroku Managed Inference and Agents. Enabled by default, this feature is designed to deliver significantly faster responses for common workloads. We took a pragmatic approach and currently only enabled this to cache system prompts and tool definitions, not user messages [...] The post Faster Agents with Automatic Prompt Caching appeared first on Heroku.