AWS Builder Center

Cutting Generative AI Latency and Costs: A Practical Guide to Amazon Bedrock Prompt Caching

Learn how Amazon Bedrock prompt caching eliminates redundant token processing. Discover how cache checkpoints slash input costs by up to 90% and reduce response latency across multi-turn chats, RAG pipelines, and autonomous agents.

When building Generative AI applications, repetitive context is virtually everywhere. Whether it is an extensive 2,000-token system prompt, large JSON tool schemas passed to an AI agent, or a massive product manual referenced across multiple user turns, models traditionally re-read and re-compute the exact same tokens on every API call.
This redundant token processing leads to two major friction points: high input costs and sluggish Time to First Token (TTFT).
With Prompt Caching on Amazon Bedrock, builders can eliminate this overhead. By caching static prefixes, you can cut input token costs by up to 90% and reduce response latency by up to 85%.

How Prompt Caching Works Under the Hood

Large language model processing occurs in two distinct phases:
  1. Input token processing (prefill): The model parses and computes the attention matrices across the prompt.
  2. Output token generation (decoding): The model generates response tokens sequentially.
Prompt caching targets the input processing stage. You place a cache checkpoint in your prompt payload right where your static content ends.
  • First Request (Cache Write): Bedrock processes the full prompt and stores the KV (Key-Value) cache for the prefix preceding the checkpoint.
  • Subsequent Requests (Cache Read): When a new request arrives with the exact same prefix, Bedrock skips recomputing that section and reads directly from the cache, instantly resuming inference for only the new, dynamic tokens.
1
2
3
4
Request 1 (Cold): [ System Prompt + Tool Schemas ] (Written to Cache) ──► New User Prompt
│
▼
Request 2 (Warm): [ CACHE READ: 90% Cheaper / Instant ] ───────────────► Next User Prompt
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article