Skip to content

docs: correct the singleFlight description and link #34 - #35

Merged
leejpsd merged 1 commit into
mainfrom
docs/single-flight-wording
Nov 23, 2026
Merged

leejpsd merged 1 commit into
mainfrom
docs/single-flight-wording

Conversation

@leejpsd

@leejpsd leejpsd commented Nov 23, 2026

Copy link
Copy Markdown
Owner

The singleFlight docs said followers skip the refresh and that the lock suppresses the stampede. It doesn't: the handler only takes a Redis lock and emits cache.stale.refresh.leader / .follower. Next.js decides to refresh after get() returns, so every instance that sees a stale entry still refreshes it. docs/architecture.md already said this; the README, docs/api.md, the option's JSDoc and the agent skill didn't.

This rewrites those four places to describe the lock as a measurement (how many instances refresh the same entry at once), and adds a short paragraph to the README pointing to #34 for an in-process L1 and fetch miss coalescing.

No behavior change. Patch changeset so the corrected JSDoc reaches npm with the next release.

The lock reports which instance saw a stale entry first. It does not stop
other instances from refreshing, because Next.js decides to refresh after
get() returns. The README, API reference, option JSDoc and agent skill
said or implied that followers skip the refresh.
@leejpsd
leejpsd merged commit 877ebee into main Nov 23, 2026
5 checks passed
@leejpsd
leejpsd deleted the docs/single-flight-wording branch November 23, 2026 18:37
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant