<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Caching on k4i's blog</title><link>https://k4i.top/tags/caching/</link><description>Recent content in Caching on k4i's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>sky_io@outlook.com (K4i)</managingEditor><webMaster>sky_io@outlook.com (K4i)</webMaster><copyright>All content is subject to the license of &lt;a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"&gt;CC BY-NC-SA 4.0&lt;/a&gt; .</copyright><lastBuildDate>Wed, 22 Apr 2026 11:30:00 +0800</lastBuildDate><atom:link href="https://k4i.top/tags/caching/index.xml" rel="self" type="application/rss+xml"/><item><title>Prefix Caching: Reusing KV Cache Across Requests</title><link>https://k4i.top/posts/prefix-caching/</link><pubDate>Wed, 22 Apr 2026 11:30:00 +0800</pubDate><author>sky_io@outlook.com (K4i)</author><atom:modified>Sun, 26 Apr 2026 16:08:06 +0800</atom:modified><guid>https://k4i.top/posts/prefix-caching/</guid><description>&lt;h2 id="problem"&gt;the repeated-prefix problem&lt;/h2&gt;
&lt;p&gt;the &lt;a href="https://k4i.top/posts/kv-cache/"&gt;KV cache&lt;/a&gt; eliminates redundant computation &lt;em&gt;within&lt;/em&gt; a single request. but in production, a different kind of redundancy is pervasive: &lt;strong&gt;many requests share the same prefix&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;three scenarios account for the majority of production traffic:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;system prompts.&lt;/strong&gt; every request to a code assistant, agent, or customer-facing chatbot begins with the same multi-kilotoken system prompt. on each new request, the server re-runs prefill over those identical tokens — then throws away the resulting KV cache when the request ends.&lt;/p&gt;</description><dc:creator>K4i</dc:creator><media:content url="https://k4i.top//images/posts/prefix-caching/cover.svg" medium="image"><media:title type="html">featured image</media:title></media:content><category>llm</category><category>inference</category><category>systems</category><category>caching</category><category>kv-cache</category><category>AI</category><category>LLM Inference Internals</category></item></channel></rss>