Architecture Deep Dive

Prompt Caching Explained: When 90% Input Discounts Actually Work (and When They Don't)

Every major LLM provider offers prompt caching with 75% to 95% discounts on repeated prefixes. Yet turning caching on without careful prefix layout yields almost zero savings.

The 4 Golden Rules for High Cache Hit Rates

  1. Keep the top of your prompt 100% static: System instructions, formatting rules, tool JSON schemas, and reference docs go first.
  2. Move dynamic metadata to the end: Timestamps, user IDs, and retrieved RAG snippets must go into the final user message.
  3. Cross the minimum token threshold: Prefixes under 1,024–2,048 tokens typically do not cache.
  4. Respect the TTL window: Ephemeral caches expire after 5–60 minutes of inactivity.

Worked Savings Example

For 2,000 queries against a 40,000-token compliance handbook on a $2.00/1M input model ($0.10/1M cached), a 90% cache hit rate cuts input spend from $160.00 down to $23.20. Simulate your own cache hit ratio inside our API Cost Comparator.

TM
TokenMeter Editorial Desk

Updated November 2026. Methodology.