Compare Architectures

Side-by-side: use case, requirements, latency, cost, strengths, weaknesses, failure modes, example — and when to choose each.

Prompt cachingSemantic caching
Use caseLarge repeated prefix: system prompt, tool schemas, documentsRepeated or near-duplicate user questions
RequirementsStable prefix ordering; provider cache supportEmbedding of queries, similarity threshold, response store, invalidation
LatencyFaster prefill on cache hitsSkips the model entirely on hits
CostCached input tokens billed at a fraction (often ~10%)Zero model cost on hits; embedding cost on every request
StrengthsTransparent, exact, no correctness riskLarge savings on FAQ-like traffic
WeaknessesOnly helps the prefix; any change invalidatesThreshold too loose returns wrong answers to similar questions
Failure modesDynamic content placed before static content kills hit rateServing a stale or personalized answer to the wrong user
Example20k-token system prompt reused across every call"What is your refund policy?" asked 5,000 times a day
Choose this whenChoose prompt caching always when you have a long stable prefix; order static content first.Choose semantic caching for high-volume, non-personalized questions, with a strict threshold and invalidation.