.nornir/assets/proxy-negcache-flow.svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 880 350" font-family="ui-sans-serif,system-ui,sans-serif" font-size="13">
<defs>
<marker id="arw" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L7,3 L0,6 Z" fill="#64748b"/>
</marker>
<style>
.box{fill:#0f172a;stroke:#334155;stroke-width:1.5}
.lbl{fill:#e2e8f0}
.sub{fill:#94a3b8;font-size:11px}
.hit{fill:#065f46;stroke:#10b981}
.neg{fill:#1e3a5f;stroke:#38bdf8}
.rem{fill:#7c2d12;stroke:#f97316}
.edge{stroke:#64748b;stroke-width:1.5;fill:none}
.elbl{fill:#94a3b8;font-size:11px}
@media (prefers-color-scheme: light){
.box{fill:#f1f5f9;stroke:#cbd5e1}
.lbl{fill:#0f172a}.sub{fill:#475569}.elbl{fill:#475569}
.hit{fill:#d1fae5;stroke:#059669}.neg{fill:#dbeafe;stroke:#2563eb}.rem{fill:#ffedd5;stroke:#ea580c}
}
</style>
</defs>
<text x="20" y="26" class="lbl" font-size="15" font-weight="700">Proxy negative cache — remember a miss for a TTL, short-circuit the upstream walk</text>
<rect class="box" x="20" y="70" width="150" height="66" rx="8"/>
<text x="95" y="98" class="lbl" text-anchor="middle" font-weight="700">request</text>
<text x="95" y="118" class="sub" text-anchor="middle">fetch(id) / GET path</text>
<rect class="box" x="210" y="66" width="150" height="74" rx="8"/>
<text x="285" y="92" class="lbl" text-anchor="middle" font-weight="700">primary?</text>
<text x="285" y="112" class="sub" text-anchor="middle">checked FIRST</text>
<text x="285" y="128" class="sub" text-anchor="middle">(never shadowed)</text>
<rect class="box hit" x="210" y="200" width="150" height="52" rx="8"/>
<text x="285" y="222" class="lbl" text-anchor="middle" font-weight="700">HIT → serve</text>
<text x="285" y="239" class="sub" text-anchor="middle">bytes / 200</text>
<rect class="box neg" x="400" y="66" width="160" height="74" rx="8"/>
<text x="480" y="92" class="lbl" text-anchor="middle" font-weight="700">neg-cache?</text>
<text x="480" y="112" class="sub" text-anchor="middle">key live (expiry > now)</text>
<text x="480" y="128" class="sub" text-anchor="middle">lazy-evict if expired</text>
<rect class="box neg" x="400" y="200" width="160" height="52" rx="8"/>
<text x="480" y="222" class="lbl" text-anchor="middle" font-weight="700">SHORT-CIRCUIT</text>
<text x="480" y="239" class="sub" text-anchor="middle">return None / 404</text>
<rect class="box" x="600" y="66" width="150" height="74" rx="8"/>
<text x="675" y="92" class="lbl" text-anchor="middle" font-weight="700">walk upstreams</text>
<text x="675" y="112" class="sub" text-anchor="middle">in order</text>
<text x="675" y="128" class="sub" text-anchor="middle">first non-404 wins</text>
<rect class="box rem" x="600" y="196" width="260" height="60" rx="8"/>
<text x="730" y="220" class="lbl" text-anchor="middle" font-weight="700">all miss → remember(key, now+TTL)</text>
<text x="730" y="238" class="sub" text-anchor="middle">bounded (NEG_CAP), reads-only, F\0/H\0 keys</text>
<line class="edge" x1="170" y1="103" x2="208" y2="103" marker-end="url(#arw)"/>
<line class="edge" x1="285" y1="140" x2="285" y2="198" marker-end="url(#arw)"/>
<text x="298" y="172" class="elbl">hit</text>
<line class="edge" x1="360" y1="103" x2="398" y2="103" marker-end="url(#arw)"/>
<text x="366" y="94" class="elbl">miss</text>
<line class="edge" x1="480" y1="140" x2="480" y2="198" marker-end="url(#arw)"/>
<text x="493" y="172" class="elbl">live</text>
<line class="edge" x1="560" y1="103" x2="598" y2="103" marker-end="url(#arw)"/>
<text x="566" y="94" class="elbl">stale/none</text>
<line class="edge" x1="675" y1="140" x2="700" y2="194" marker-end="url(#arw)"/>
</svg>