A cancelled caller shouldn’t cancel everyone’s work.
Imagine a hundred callers asking for the same public resource. The cache is empty, so one fetch starts while the other callers wait for its result.
Now the first caller disconnects. Should everyone lose the fetch?
Separate the caller from the work
The first caller happened to arrive first. That does not make its connection a good owner for work other people need.
WireCache gives a shared origin fetch its own lifecycle. A caller can stop waiting without automatically taking the shared fetch down with it. This separates two decisions: whether a particular caller still needs a response, and whether the shared operation should continue.
This is useful only when sharing is appropriate. Requests with private credentials, unsuitable headers, or otherwise incompatible cache profiles must not be treated as interchangeable.
Completion needs to be remembered
Waiting for a notification is not the same as knowing the outcome. A caller might begin waiting just after the fetch finishes. If the completion existed only as a momentary signal, that caller could miss it.
WireCache retains terminal outcomes for the shared operation. A waiter needs a result it can inspect as well as a way to learn that the state changed. Success, failure, and cancellation paths all need a defined end.
Independent ownership still needs limits
A fetch that outlives one connection should not outlive every useful boundary.
Origin deadlines, waiter deadlines, limits on active fetches, and limits on waiting callers answer different questions. Together, they keep shared work from turning into an unbounded collection of background tasks.
Invalidation adds another boundary. An older fetch can finish after a newer mutation. WireCache uses version tokens so that stale completion cannot put an outdated value back into the cache.
Try the simpler picture first
The request explorer illustrates the basic cold-cache and warm-cache paths. It deliberately leaves out races, individual waiter deadlines, and private response handoffs.
For the actual project behavior, see the flight ownership decision and the project overview. The repository’s controlled burst test is evidence for its tested workload, rather than a claim about arbitrary traffic.
The question I find useful is simple: if a caller disappears, who still owns the work—and what will eventually stop it?