Prompt Caching & MCP Protocol: Production AI Optimization
By Dorian Laurenceau
Updated
π Last reviewed: April 24, 2026. Updated with April 2026 findings and community feedback.
Prompt Caching & MCP: Optimizing AI for Production
You have built a powerful AI system. It works beautifully... for $0.15 per query. At 100,000 queries per day, that is $15,000 daily. Production AI is an optimization problem: how do you maintain quality while reducing cost and latency? Prompt caching and the Model Context Protocol (MCP) are two key tools for this challenge.
The part of prompt caching nobody optimises for (until it bites)
The standard pitch is caching = save 80-90% on tokens. True. What gets left out of most write-ups, and what engineers on r/LangChain and r/OpenAI keep learning the hard way, is that caching is only a win when your cache hits. And whether it hits depends on architectural choices that look innocent until you measure them.
Three concrete traps worth naming:
- βTTL asymmetry is real. Anthropic's default TTL is 5 minutes, OpenAI's 1 hour, Google's in between. If your traffic is bursty with 10+ minute quiet periods, Anthropic's cache will evaporate between bursts and your "savings" will quietly vanish. Anthropic's prompt caching docs now offer 1-hour cache tiers at a premium β worth the math for quiet-but-steady workloads.
- βCache boundaries must match change frequency. If you shuffle RAG chunks into a different order between requests, the cache breaks. Sort retrieved chunks by a stable key (document ID) before concatenating; this single change has single-handedly saved teams five-figure monthly bills.
- βDynamic system prompts are a silent cache killer. Injecting the current timestamp or a user ID into the system prompt seems harmless. It invalidates the cache on every request. Move anything dynamic to the end of your prompt, always.
On the MCP side, the official Model Context Protocol spec is short and readable; if you're still writing bespoke function schemas per vendor in 2026, you're building tech debt. The MCP announcement from Anthropic is worth five minutes to understand why this standard won the race.
Prompt Caching: Stop Paying Twice for the Same Tokens
Every API call sends your system prompt + RAG context + conversation history. If your system prompt is 2,000 tokens and stays the same across all queries, you are paying for those 2,000 tokens every single time. Prompt caching tells the API: "I already sent this prefix, just reuse it."
How Prompt Caching Works
From repeated payment to cached efficiency
Without Caching
Request 1: [8000 static tokens] + [2000 dynamic tokens] = 10,000 tokens billed
Request 2: [8000 static tokens] + [2000 dynamic tokens] = 10,000 tokens billed
Request 3: [8000 static tokens] + [2000 dynamic tokens] = 10,000 tokens billed
Total: 30,000 tokens billed for 6,000 tokens of unique contentπ‘ 80% of your token spend is WASTED on resending identical content.
What is the best way to maximize cache hit rates?
MCP: The Model Context Protocol
Before vs After MCP
β Scroll horizontally β
MCP Architecture
How the protocol connects models to tools
MCP Server
MCP Server: 'Weather Service'
Tools:
- get_weather(city, units)
- get_forecast(city, days)
Resources:
- weather://cities -> list of supported cities
- weather://alerts -> active weather alertsπ‘ An MCP server is a standardized wrapper around any API or data source.
Production Optimization Checklist
Test Your Understanding
Question 1 of 5.
Prompt Caching & MCP Knowledge Check
0 / 5 answered
Q1.How much can prompt caching reduce API costs?
5 questions remaining
Congratulations!
You have completed Module 9 and the entire advanced AI curriculum. You now understand:
- βContext engineering, designing the information environment for AI
- βLost-in-the-middle, position effects and optimization
- βProduction optimization, caching, MCP, and cost management
These are the skills that separate prompt hobbyists from production AI engineers.
Return to the Module 9 overview to review your progress and explore next steps.
Module 9 β Context Engineering
Master the art of managing context windows for optimal results.
Dorian Laurenceau
Full-Stack Developer & Learning DesignerFull-stack web developer and learning designer. I spent 4 years as a freelance full-stack developer and 4 years teaching React, JavaScript, HTML/CSS and WordPress to adult learners. Today I design learning paths in web development and AI, grounded in learning science. I founded learn-prompting.fr to make AI practical and accessible, and built the Bluff app to gamify political transparency.
One practical AI workflow in your inbox
Methods, resources and new exercises. Free, unsubscribe at any time.
βRelated articles
FAQ
What will I learn in this Advanced Techniques guide?+
Learn prompt caching strategies to reduce AI costs by 90%. Understand the Model Context Protocol (MCP) for standardized tool integration. Master production-grade AI system optimization.