<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ps4Atom</title>
    <description>The latest articles on DEV Community by Ps4Atom (@ps4emp).</description>
    <link>https://dev.to/ps4emp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1075964%2F13b8350a-040f-4c78-95b4-9af97bd72b10.jpeg</url>
      <title>DEV Community: Ps4Atom</title>
      <link>https://dev.to/ps4emp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ps4emp"/>
    <language>en</language>
    <item>
      <title>Has anyone else seen prompt caching break because of UUIDs/timestamps near the front?</title>
      <dc:creator>Ps4Atom</dc:creator>
      <pubDate>Mon, 29 Jun 2026 09:00:20 +0000</pubDate>
      <link>https://dev.to/ps4emp/has-anyone-else-seen-prompt-caching-break-because-of-uuidstimestamps-near-the-front-1j78</link>
      <guid>https://dev.to/ps4emp/has-anyone-else-seen-prompt-caching-break-because-of-uuidstimestamps-near-the-front-1j78</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;I’ve been working on an open-source tool called CacheSentry, and I’m looking for feedback from people building real LLM apps.&lt;/p&gt;

&lt;p&gt;The problem it focuses on is prompt-cache regressions.&lt;/p&gt;

&lt;p&gt;In long-prompt apps, the beginning of the prompt is often mostly stable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system instructions&lt;/li&gt;
&lt;li&gt;tool schemas&lt;/li&gt;
&lt;li&gt;policies&lt;/li&gt;
&lt;li&gt;retrieved context&lt;/li&gt;
&lt;li&gt;memory&lt;/li&gt;
&lt;li&gt;conversation structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But small dynamic fields can accidentally get inserted near the front:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UUIDs&lt;/li&gt;
&lt;li&gt;timestamps&lt;/li&gt;
&lt;li&gt;request IDs&lt;/li&gt;
&lt;li&gt;session IDs&lt;/li&gt;
&lt;li&gt;dynamic metadata&lt;/li&gt;
&lt;li&gt;shuffled tool/schema order&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That can silently destroy the stable prefix and reduce prompt-cache reuse.&lt;/p&gt;

&lt;p&gt;In one controlled validation I ran:&lt;/p&gt;

&lt;p&gt;Stable prompt: 2,816 cached tokens&lt;br&gt;&lt;br&gt;
UUID near the front: 0 cached tokens&lt;br&gt;&lt;br&gt;
UUID moved later: 2,816 cached tokens again&lt;/p&gt;

&lt;p&gt;That was the moment I realized this is the kind of issue most teams probably won’t catch in code review.&lt;/p&gt;

&lt;p&gt;So I built CacheSentry.&lt;/p&gt;

&lt;p&gt;It analyzes prompt traces and can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compare against a known-good baseline&lt;/li&gt;
&lt;li&gt;detect dynamic fields near the stable prefix&lt;/li&gt;
&lt;li&gt;estimate reusable token loss&lt;/li&gt;
&lt;li&gt;identify the culprit field&lt;/li&gt;
&lt;li&gt;fail CI when cacheability regresses&lt;/li&gt;
&lt;li&gt;compare predictions with runtime cache signals where available&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea is simple:&lt;/p&gt;

&lt;p&gt;Unit tests check correctness.&lt;br&gt;&lt;br&gt;
Evals check output quality.&lt;br&gt;&lt;br&gt;
Observability checks latency and cost.&lt;br&gt;&lt;br&gt;
CacheSentry checks whether a prompt/template change broke cacheability.&lt;/p&gt;

&lt;p&gt;Repo:&lt;br&gt;
&lt;a href="https://github.com/PS4Emp/cachesentry" rel="noopener noreferrer"&gt;https://github.com/PS4Emp/cachesentry&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m especially interested in feedback from people building agents, RAG systems, long-context apps, LiteLLM gateways, or OpenTelemetry-based LLM observability.&lt;/p&gt;

&lt;p&gt;Has anyone here seen prompt caching behave unexpectedly because dynamic content moved too early in the prompt?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>llm</category>
      <category>performance</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
