This is not a cache. A cache miss costs a recomputation; here a duplicate execution is the bug, so nothing is best-effort. The package tracks a key through first sight, in flight, completed and forgotten, checks the fingerprint, and replays what was stored. Everything else is listed below with where it goes.
mycocepurus-smithii/http, for
WHATWG Request; an Express or Fastify adapter would sit over the same
three calls.scope function (see Concepts).refuse is required and returns your Response;
statusFor gives the draft's 400, 409 or 422.shouldStore is required. Stripe
remembers everything, 4xx included, and storeAnything is that choice;
write your own if a 500 should be retried instead of replayed.retainFor, leaseFor and maxKeyLength. All required. Set
leaseFor longer than your slowest handler or a slow first attempt and its
retry both run.SingleFlight in front of the ledger makes in-process copies
share one run; across processes, the client retries after the 409./http
fingerprint covers method, path and query, and body. Pass your own
fingerprint if you need more.claim is rethrown
unchanged; wrap the store or catch it and choose between failing the
request and running it unguarded. A failed complete after the action ran
is reported through onEvent, not thrown, and the value is returned.process.env. Events go to onEvent,
configuration is the options object, and hashing uses
globalThis.crypto.MemoryStore is atomic only because JavaScript is single-threaded and its
check-and-set has no await. It evicts the least recently used entry past
maxEntries. Two processes means two stores and a double run, so use a
Redis or Postgres store there; the README's quick start says what one needs.
No benchmarks yet.