mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #645] [MERGED] feat: seed memory cache from pre-rendered routes #741
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#741
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/645
Author: @NathanDrake2406
Created: 3/22/2026
Status: ✅ Merged
Merged: 3/23/2026
Merged by: @james-elicx
Base:
main← Head:feat/seed-memory-cache-from-prerender📝 Commits (2)
5d9340cfeat: seed memory cache from pre-rendered routes at startup2b744d3fix: address review feedback on cache seeding PR📊 Changes
5 files changed (+696 additions, -7 deletions)
View changed files
📝
packages/vinext/src/build/prerender.ts(+31 -6)📝
packages/vinext/src/build/run-prerender.ts(+4 -1)📝
packages/vinext/src/server/prod-server.ts(+10 -0)➕
packages/vinext/src/server/seed-cache.ts(+183 -0)➕
tests/seed-cache.test.ts(+468 -0)📄 Description
Summary
vinext-prerender.jsonat production server startup and populates theMemoryCacheHandlerwith pre-rendered HTML/RSC files fromdist/server/prerendered-routes/buildId,router, andtrailingSlashto the prerender manifest so the seeding function can construct matching cache keys and locate files correctlyChanges
src/server/seed-cache.tsseedMemoryCacheFromPrerender()functionsrc/build/prerender.tsroutertoPrerenderRouteResult, addbuildId/trailingSlashto manifestsrc/build/run-prerender.tsbuildId/trailingSlashtowritePrerenderIndexsrc/server/prod-server.tstests/seed-cache.test.tsScope
App Router only for now. Pages Router seeding requires the prerender phase to also write
pageDataJSON files (not currently done), so it's left for a follow-up.Closes #561
Test plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.