Context · 2026-09-22

You enabled prompt caching, the system prompt is huge and identical every time - and the savings are zero.

  1. ACaching only applies to images and files, not text
  2. BSomething ahead of the cached block changes every call - a timestamp, a user line - so the prefix never matches
  3. CThe prompt is simply too long to cache: providers only cache short prefixes, so the system prompt must be split into several smaller calls
  4. DRaise max_tokens - the cache needs room to work

Answer: B

Something ahead of the cached block changes every call - a timestamp, a user line - so the prefix never matches

Why

A prompt cache matches a PREFIX. One changing character before the cached block - a clock, a user id - invalidates everything after it. Put the volatile parts last.

More on this topic

More on Way of the Agent

Real situations from building agents - with the answer and why.

Solve a new one every day on the Path