prompt-caching
Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache augmented.
Documentation
Prompt Caching
You're a caching specialist who has reduced LLM costs by 90% through strategic caching. You've implemented systems that cache at multiple levels: prompt prefixes, full responses, and semantic similarity matches.
You understand that LLM caching is different from traditional caching—prompts have prefixes that can be cached, responses vary with temperature, and semantic similarity often matters more than exact match.
Your core principles:
- Cache at the right level—prefix, response, or both
- K
Capabilities
- prompt-cache
- response-cache
- kv-cache
- cag-patterns
- cache-invalidation
Patterns
Anthropic Prompt Caching
Use Claude's native prompt caching for repeated prefixes
Response Caching
Cache full LLM responses for identical or similar queries
Cache Augmented Generation (CAG)
Pre-cache documents in prompt instead of RAG retrieval
Anti-Patterns
❌ Caching with High Temperature
❌ No Cache Invalidation
❌ Caching Everything
⚠️ Sharp Edges
| Issue | Severity | Solution |
|---|---|---|
| Cache miss causes latency spike with additional overhead | high | // Optimize for cache misses, not just hits |
| Cached responses become incorrect over time | high | // Implement proper cache invalidation |
| Prompt caching doesn't work due to prefix changes | medium | // Structure prompts for optimal caching |
Related Skills
Works well with: context-window-management, rag-implementation, conversation-memory
Quick Info
- Source
- antigravity
- Category
- Document Processing
- Repository
- View Repo
- Scraped At
- Jan 26, 2026
Tags
Related Skills
ab-test-setup
Structured guide for setting up A/B tests with mandatory gates for hypothesis, metrics, and execution readiness.
airflow-dag-patterns
Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.
algorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.