Build1 distinct publisher3 min readPublished
The provider cache discounts a repeated prefix, and the worst case is bounded arithmetic. The semantic cache deletes the call outright, but a miss there means a wrong answer, not a rounding error, so the threshold sweep matters more than the hit rate.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
One query in this harness costs $0.00144 at the rates the author assumes: 800 input tokens at $0.80 per million, 200 output tokens at $4.00 per million [7][8][1]. Output is 55.6% of that total [2]. Prompt caching does not reduce output token cost at all. It discounts the repeated prefix only, which here is the 400-token system prompt [8].
Run the multipliers and prompt caching stops being a decision. A read on the marked prefix bills at 0.1x the input rate, a saving of $0.000288, or 20% of the query [1][3]. A write bills at 1.25x, a premium of $0.00008 on that prefix [1][d4a]. Premium divided by saving is 0.28, so the first read inside the window pays for the write and then some [5]. The whole intervention is one field: `cache_control` set to `ephemeral` on the system block, with `cache_read_input_tokens` and `cache_creation_input_tokens` returned in `usage` so you can price it yourself [10].
That leaves the expiry window as the only real variable, and it is a traffic-shape question rather than a token question [13]. What you want before switching it on is the distribution of gaps between requests that share a prefix.
Semantic caching is a different bargain because the call disappears. A hit returns the stored answer and the entire $0.00144 goes with it, output included, which is five times what a prompt-cache read recovers on the same query [4][6]. The price of that leverage is a single float. The harness pins cosine similarity at 0.92 and treats it as the parameter to sweep [9], because that number is what adjudicates the paraphrase and typo-variant buckets: at one setting they are hits, at another they are wrong answers that register as hits [6].
The table that matters most is missing from the supplied text, which breaks off inside the definition of the evaluation function that would score cached answers against ground truth [17]. What is present is the harness and the cost model, and the author's stated requirement is that both run locally on an API key with no customer secrets [15]. The embedding side is a local all-MiniLM-L6-v2 model, so a lookup costs CPU rather than tokens [16]. It also costs a scan: the published code walks every `qa:*` key in Redis and computes the cosine in Python for each stored item [c11a]. At a few hundred keys that is invisible. Semantic-cache latency therefore grows with cache size, which runs opposite to prompt caching, where the provider-side hit is reported to improve latency as well as cost [c3b].
For a measured break-even to transfer to your traffic, three things have to hold. Your repeat share has to resemble that synthetic mix rather than being mostly novel questions [6]. Your stored answers have to stay correct for as long as they sit in Redis, because the lookup compares query vectors and never re-checks the answer it is about to serve [c11a]. And someone has to own the false-positive rate at whatever threshold you ship, which means owning it as a product decision, not a cache configuration [4].
Ranked by verification strength, evidence, and original report placement.
Per Anthropic's official documentation as cited by the dev.to article, a prompt cache read is billed at 0.1x the input token price and a cache write at 1.25x.
Reusing a cached prefix cuts the input token cost of that portion by 90%.
Semantic caching (for example Redis Semantic Cache or GPTCache) uses embedding vector similarity to judge that a question is nearly the same as one seen before, skips the LLM call entirely and returns the stored response, which removes output token cost as well, but carries the reliability risk that a false positive returns a wrong answer.
The measurement design uses 1,200 queries: 300 unique queries crossed with four repeat patterns (identical repeats, paraphrased repeats, typo-containing variants, and 25% unique queries).
The harness assumes a Claude Haiku 3.5 class model priced at $0.80 per million input tokens and $4.00 per million output tokens, based on Anthropic's official price list.
The average query in the harness is 800 input tokens (400 system prompt plus 400 user query) and 200 output tokens.
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 29, 2026
Follow any of these and your For You feed starts watching them — no settings page required.
build
Anthropic's GA Files API re-bills the whole document on every request1 distinct publisher
build
Tier the models; the validation boundary is the thing you are actually buying1 distinct publisher
build
Per-tenant Claude clients belong in the dependency graph, not in middleware1 distinct publisher
build
A cached prompt prefix repays its write premium on the second request1 distinct publisher
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Arithmetic verifiable, results absent
Two very different grades of evidence sit in the same post. The pricing structure is checkable and holds: the 0.1x read and 1.25x write come from Anthropic's published rates, and every cost figure here — $0.00144 a query, $0.000288 saved per prefix read, $1.73 for the whole run — falls straight out of the post's own cost function. The measurements the headline rests on do not exist on the page. No hit rate, no false-positive rate, no point on the 0.90–0.98 threshold sweep the piece calls the heart of the question, and the text breaks off mid-word before the combined-caching section.
No deployment evidence
Nobody's production system appears in this reporting. The only field data point is a roughly 67% saving reported elsewhere by martinkostov.me, retold in a sentence and explicitly not trusted by the author. Redis Semantic Cache and GPTCache are named as available options, not as things anyone here is running. We will not convert a synthetic harness into an adoption signal.
Promised real traffic, delivered a harness
The overreach is in the framing rather than the numbers. A headline offering the break-even point on real traffic leads to 300 synthetic questions crossed with four repeat patterns, and the promised measurement is described instead of shown. Latency is said to improve meaningfully with no clock anywhere in the code. Against that, the piece actively deflates the genre it belongs to — it tells readers not to trust unverified 'up to 90%' claims, declines to accept the 67% case it cites, and its own arithmetic is conservative and correct. The cap on a prompt cache read is 20% of a query, not 90% of a bill, and the post says so.
Mild self-promotion, no vendor stake
There is a plug in here: the methodology is presented as the way things are done in the author's own Proof Studio, and the piece is published on a platform where a developer's reputation is the product. But nothing in the recommendation set favours a paid tool — Anthropic's rates are quoted from the public price list, the semantic layer is open-source Redis with a local MiniLM encoder, and the standing advice is to measure your own traffic rather than adopt anything. The clearest tell of restraint is that the author refuses to reuse a flattering third-party 67% figure and reports a lower number instead.
Solid on price mechanics, thin on outcomes
Confidence splits along the same seam as the evidence. On how the two caches bill and how they differ — prefix discount inside a request versus a whole response reused across requests — we are on firm ground, and the derived ratios are arithmetic that anyone can redo. On what either cache actually delivers on live traffic, one publisher's unfinished write-up is all there is, with an unpublished sweep, a 63% figure nobody can inspect, and code that names a different model than the price sheet does.