LogoSteve
  • Blog
  • About
What Is Prompt Caching TTL?
2026/03/30

What Is Prompt Caching TTL?

TTL is the lifetime of a prompt cache entry. Each hit refreshes it. Leave it unused for long enough, and it expires.

TTL stands for Time To Live: the amount of time a cache entry can survive without being used.

For prompt caching, TTL tells you how long a cached prefix can stay alive before the system discards it.

Start With a Concrete Example

A carton of milk has the same timing problem:

You buy milk with a shelf life of 5 days

Day 1  still fresh
Day 2  still usable
Day 5  last valid day
Day 6  expired and thrown away

Prompt cache TTL works the same way:

00:00  First request writes a prefix into cache
02:30  Another request hits the cache, TTL resets to 5 minutes
07:29  Another hit refreshes the timer again
12:30  No one uses it for 5 minutes, cache expires
12:31  A new request arrives, misses cache, and must rewrite it at full cost

Typical TTL Differences Across Providers

ProviderTTLConfigurableRefreshed on hit
Anthropic Claude5 minutesNoYes
OpenAIMinutes to hoursNo, opaqueOpaque
Google GeminiDeveloper-defined, 1 hour by defaultYesYes

If requests keep arriving, the cache stays alive. If usage pauses for too long, the entry expires and the next request has to write it again at full cost.

All Posts

Author

avatar for Steve
Steve

Categories

  • AI
Start With a Concrete ExampleTypical TTL Differences Across Providers

More Posts

Is a Worktree Temporary?
Development

Is a Worktree Temporary?

Usually yes. A worktree works best as a disposable task folder: create it for the job, merge the branch, then remove the directory and keep the commits.

avatar for Steve
Steve
2026/03/30
Is Multi-Agent Worktree Just Git Worktree?
Development

Is Multi-Agent Worktree Just Git Worktree?

Yes. It is git worktree used as isolation for agent workflows: one repository, multiple directories, and far fewer workspace collisions.

avatar for Steve
Steve
2026/03/30
What Is the Scope of Prompt Caching?
AI

What Is the Scope of Prompt Caching?

Prompt caching is driven by prefix matching, not by session identity. If the same prefix shows up again, reuse can happen across conversations and sometimes across users.

avatar for Steve
Steve
2026/03/30
LogoSteve

Steve's Blog

© 2026 Steve