Lesson 26 of 30
The same long system prompt gets reprocessed, and rebilled, on every single request — prompt caching is providers letting you stop paying that price twice.
11 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
What does prompt caching actually let you skip on a repeated request?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Every request to an LLM API sends the full prompt as tokens, and the provider has to process every one of those tokens before it can generate a response — that processing costs money and takes time, even for the part of the prompt that's identical to the last request. Prompt caching is a provider feature that lets you mark a prefix of your prompt (the part that doesn't change between calls) as cacheable, so on subsequent requests the provider can reuse its already-computed internal representation of that prefix instead of reprocessing it from scratch.
The part worth being precise about: it's a prefix. Caching works because the provider can recognize "the first N tokens of this request are byte-for-byte identical to the first N tokens of a request I processed recently." That means only content that's stable and comes first in the prompt is cacheable — a long, unchanging system prompt, or a large retrieved document that's the same across a session, both qualify. The user's actual message, which changes every turn and comes last, doesn't.
This isn't a niche optimization — for any feature that sends a large, mostly-static system prompt or context block on every call (which describes most production LLM features, including this app's own tutor and interview prompts), caching is a direct, meaningful lever on both cost (cached tokens are billed at a steep discount) and latency (skipping reprocessing means a faster response).
System prompt (2,000 tokens, identical every single call):
"You are a tutor. Answer only from the provided lesson context.
Lesson context: <full lesson content>..."
User message (changes every turn):
"Can you explain this differently?"
Without caching, every single turn in a tutoring conversation reprocesses that entire 2,000-token system prompt from zero, even though it hasn't changed since the conversation started. With prompt caching, the provider recognizes the identical prefix on the second, third, and every subsequent call in that session and skips reprocessing it — you're billed the discounted cached rate for those tokens instead of the full rate, on every turn after the first.
"Our AI feature's costs are too high — what would you look at first?" is a real question, and a stable, repeated system prompt or RAG context that isn't using prompt caching is one of the first concrete, load-bearing answers worth naming.