mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #432] [MERGED] fix(fetch-cache): register stale-while-revalidate refetch with waitUntil() #569
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#569
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/432
Author: @Divkix
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @james-elicx
Base:
main← Head:fix/fetch-cache-waituntil📝 Commits (2)
37dc4dbfix(fetch-cache): register stale-while-revalidate refetch with waitUntil()99497eaci: re-trigger CI📊 Changes
2 files changed (+41 additions, -2 deletions)
View changed files
📝
packages/vinext/src/shims/fetch-cache.ts(+6 -2)📝
tests/fetch-cache.test.ts(+35 -0)📄 Description
Fixes #438
Summary
ExecutionContext.waitUntil()so Cloudflare Workers keeps the isolate alive until the refetch completesgetRequestExecutionContext()ALS accessor, matching the pattern already used by ISR inisr-cache.tsTest plan
registers stale background refetch with waitUntil when ExecutionContext is available— creates mock ExecutionContext, populates cache, expires entry, triggers stale hit, assertswaitUntilwas called with the refetch promise🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.