# Advanced Prompt Caching at Scale

DevFeed: [Advanced Prompt Caching at Scale](<https://devfeed.tech/articles/advanced-prompt-caching-at-scale-19856.md>)

Original publisher: [Read original article](<https://www.digitalocean.com/blog/advanced-prompt-caching>)

Author: Andrew Dugan

Published: 2026-04-07T19:11:40Z

Content type: article

Language: en

Sources: [DigitalOcean](<https://devfeed.tech/sources/digitalocean.md>)

Topics: [Cache](<https://devfeed.tech/topics/cache.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [prompt](<https://devfeed.tech/topics/prompt.md>), [vllm](<https://devfeed.tech/topics/vllm.md>), [TensorRT-LLM](<https://devfeed.tech/topics/tensorrt-llm.md>), [model architecture](<https://devfeed.tech/topics/model-architecture.md>)

Tags: [ai-ml](<https://devfeed.tech/tags/ai-ml.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [attention](<https://devfeed.tech/tags/attention.md>), [automatically](<https://devfeed.tech/tags/automatically.md>), [balancing](<https://devfeed.tech/tags/balancing.md>), [caching](<https://devfeed.tech/tags/caching.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [fleet](<https://devfeed.tech/tags/fleet.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [inference](<https://devfeed.tech/tags/inference.md>), [load-balancing](<https://devfeed.tech/tags/load-balancing.md>), [matching](<https://devfeed.tech/tags/matching.md>), [model](<https://devfeed.tech/tags/model.md>), [model-architecture](<https://devfeed.tech/tags/model-architecture.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [prefix-caching](<https://devfeed.tech/tags/prefix-caching.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [prompt-caching](<https://devfeed.tech/tags/prompt-caching.md>), [replica](<https://devfeed.tech/tags/replica.md>), [request](<https://devfeed.tech/tags/request.md>), [scale](<https://devfeed.tech/tags/scale.md>)

## AI overview

Within one replica, vLLM, SGLang (via RadixAttention), and TensorRT-LLM can automatically reuse cached prompt prefixes. At fleet scale, the excerpt says each replica's cache lives in its own GPU VRAM; with round-robin routing, a repeated prompt has only a 1/N chance of reaching the replica holding its cached prefix, so hit rates can fall as replicas increase. The excerpt frames deliberate architecture as necessary to preserve caching benefits and cites possible discounts of 50-90% on cached input tokens and up to 80% lower time-to-first-token latency. It ends before describing the scaling strategies or comparing framework behavior across replicas.

## Source excerpt

Introduction Prompt caching is the process of reusing already computed KV states across inference requests in order to save money and reduce latency. Within a single replica, modern inference engines like vLLM, SGLang, and TensorRT-LLM handle it automatically. Incoming prompts are matched against cached prefixes and recomputed only where necessary, without requiring user configurations The problem nobody talks about is what happens when you scale to many replicas. Under round-robin load balancing, a request with an identical prefix has only a 1/N chance of hitting the replica where that prefix is already cached. The cache hit rate that made prompt caching so attractive at one replica degrades almost linearly as your fleet grows, unless you architect around it deliberately. Done right, prompt caching at scale offers 50-90% discounts on cached input tokens and can reduce time-to-first-token (TTFT) latency by up to 80%. This article covers the architectural strategies that make that possible. The Single-Replica Ceiling Refer to our previous prompt caching article for a detailed explanation of how KV caching works under the hood. Every transformer-based LLM uses KV caching to store key and value vectors from the attention layers in GPU VRAM during decoding. This intra-request caching is baked into the model architecture to increase throughput and maximize efficiency. Within a single replica, modern open-source engines like vLLM, SGLang (via RadixAttention), and TensorRT-LLM support automatic prefix caching out of the box, matching incoming prompts against previously cached prefixes to maximize KV reuse without any user configuration. Reusing KV states across requests from many users and replicas is where inference frameworks differ significantly. In the simplest architecture, the cache lives on individual replicas in VRAM. It is not shared across model instances at all. When a user makes an inference request, the prompt from their request is cached on a single replica.