<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caching on Brian Faust</title><link>https://wimdy.works/tags/caching/</link><description>Recent content in Caching on Brian Faust</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate><atom:link href="https://wimdy.works/tags/caching/rss.xml" rel="self" type="application/rss+xml"/><item><title>A Cache Hit Still Has a Payload</title><link>https://wimdy.works/thoughts/a-cache-hit-still-has-a-payload/</link><pubDate>Mon, 15 Jun 2026 00:00:00 +0000</pubDate><guid>https://wimdy.works/thoughts/a-cache-hit-still-has-a-payload/</guid><description>&lt;p&gt;The rules were cached. The expensive graph had already been compiled. A warm
request should have been the easy case, yet loading that prepared data was
still taking enough work to deserve its own investigation. The cache was
working; the representation inside it was the problem.&lt;/p&gt;
&lt;p&gt;One attempted fix was to cache a larger, ready-to-use pricing profile and skip
reconstruction. That made cache-hit performance worse. Later, compacting rows
helped, moving their expansion helped, and then keeping one expensive family
expanded helped too. Apparently contradictory results, until you follow where
each version made the request do its work.&lt;/p&gt;</description></item><item><title>Compile Published Rules Before the Quote Arrives</title><link>https://wimdy.works/thoughts/compile-published-rules-before-the-quote-arrives/</link><pubDate>Fri, 01 May 2026 00:00:00 +0000</pubDate><guid>https://wimdy.works/thoughts/compile-published-rules-before-the-quote-arrives/</guid><description>&lt;p&gt;A cache flush shouldn&amp;rsquo;t make the next quote rebuild a price book that was
already published. The shipment is new. The structure of the tariff isn&amp;rsquo;t.
Yet “load the graph, prepare it, cache it” puts both jobs back on the request
as soon as the cache disappears.&lt;/p&gt;
&lt;p&gt;That boundary changed during development of my private rating engine.
First, published rulesets gained a persisted runtime projection. Later,
supporting configuration gained a separate persisted bundle. These changes
didn&amp;rsquo;t precompute shipment prices. They gave repeated preparation somewhere
to survive other than a volatile cache.&lt;/p&gt;</description></item><item><title>A Cache Hit Is Not a Freshness Guarantee</title><link>https://wimdy.works/thoughts/a-cache-hit-is-not-a-freshness-guarantee/</link><pubDate>Tue, 01 Apr 2025 00:00:00 +0000</pubDate><guid>https://wimdy.works/thoughts/a-cache-hit-is-not-a-freshness-guarantee/</guid><description>&lt;p&gt;A catalogue price is cached at revision 1. The database commits revision 2.
Three seconds later, Laravel finds the key and returns revision 1 from inside
its declared five-second fresh window.&lt;/p&gt;
&lt;p&gt;The cache hit is real. So is the stale price.&lt;/p&gt;
&lt;p&gt;In the &lt;a href="https://wimdy.works/reproductions/lar-06/"&gt;LAR-06 fixture&lt;/a&gt;
, the cached JSON is well formed and its
SHA-256 hash matches its body. Nothing has expired or become corrupt. The
failure is semantic: &lt;code&gt;current-price&lt;/code&gt; requires the acknowledged source
revision, while the cache only knows that a key still contains bytes.&lt;/p&gt;</description></item><item><title>Cache the Deployment, Not the Assumption</title><link>https://wimdy.works/thoughts/cache-the-deployment-not-the-assumption/</link><pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate><guid>https://wimdy.works/thoughts/cache-the-deployment-not-the-assumption/</guid><description>&lt;p&gt;Release B serves &lt;code&gt;/inventory&lt;/code&gt; and labels its catalogue &lt;code&gt;green&lt;/code&gt;. The code is
correct. The environment is correct. Yet the application answers &lt;code&gt;/catalogue&lt;/code&gt;
with &lt;code&gt;blue&lt;/code&gt;, while &lt;code&gt;/inventory&lt;/code&gt; returns &lt;code&gt;404&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Nothing corrupted Laravel&amp;rsquo;s generated files. They contain release A&amp;rsquo;s
configuration and route table because release A created them. The deployment
combined those files with release B and produced a system which is consistently
wrong.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;config:cache&lt;/code&gt; and &lt;code&gt;route:cache&lt;/code&gt; are often introduced as performance switches.
That description misses their more important property: each command turns a
set of inputs into a generated artifact. If the artifact is deployed, it must
carry the same release identity as the code and environment which produced it.&lt;/p&gt;</description></item><item><title>A Cache Must Distinguish Empty from Unavailable</title><link>https://wimdy.works/thoughts/a-cache-must-distinguish-empty-from-unavailable/</link><pubDate>Mon, 01 Oct 2018 00:00:00 +0000</pubDate><guid>https://wimdy.works/thoughts/a-cache-must-distinguish-empty-from-unavailable/</guid><description>&lt;p&gt;A cached search returns two pickup locations. One location is deleted locally,
but the search keeps returning both.&lt;/p&gt;
&lt;p&gt;The tempting repair is a shorter time to live. That trades a known correctness
bug for a shorter known correctness bug. The system already knows the cached
answer is false; waiting five minutes instead of an hour does not make it less
false. A TTL is not invalidation with worse timing.&lt;/p&gt;
&lt;p&gt;The opposite failure looks similar. A remote lookup returns nothing during an
outage. Replacing the cache with an empty list would remove locations which may
still exist.&lt;/p&gt;</description></item></channel></rss>