Skill 4.1.4
Create intelligent caching systems to reduce costs and improve response times by avoiding unnecessary FM invocations (for example, by using semantic caching, result fingerprinting, edge caching, deterministic request hashing, prompt caching)
Key Concepts
Prompt caching in Bedrock caches a repeated prompt prefix, such as a long system prompt or document, marked with cache checkpoints. Later requests that reuse the prefix within the cache lifetime read it at a reduced token price and with lower latency. It suits long, stable context reused across many requests.
Exact-match caching stores responses keyed by a deterministic hash of the normalised request (model, prompt version, parameters, input) in ElastiCache or DynamoDB; fingerprinting of results detects duplicates. Semantic caching embeds the question and returns a stored answer when a previous question is similar enough, for example with vector search in ElastiCache or OpenSearch. Edge caching with CloudFront serves common non-personalized responses close to users. Caches need expiry tied to data freshness.