You enabled prompt caching, the system prompt is huge and identical every time - and the savings are zero.
- ACaching only applies to images and files, not text
- BSomething ahead of the cached block changes every call - a timestamp, a user line - so the prefix never matches
- CThe prompt is simply too long to cache: providers only cache short prefixes, so the system prompt must be split into several smaller calls
- 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.
- ContextInstructions placed in the middle of a very long prompt are followed far less often than the same words at the start or end.
- ContextYour agent resends a long system prompt on every step, yet DeepSeek’s usage shows almost no cache hits.
- ContextAfter many tool calls returning huge blobs, the agent slows down and loses the thread.
- ContextA long conversation is nearing the context-window limit and you must free space.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path