mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #736] [MERGED] fix(tpr): use correct KV cache key format matching runtime #807
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#807
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/736
Author: @NathanDrake2406
Created: 4/1/2026
Status: ✅ Merged
Merged: 4/1/2026
Merged by: @james-elicx
Base:
main← Head:fix/tpr-kv-key-format📝 Commits (5)
00b3972fix(tpr): use correct KV cache key format matching runtimed1a0527fix(tpr): read buildId from BUILD_ID file instead of prerender manifestbc1d548address bonk review comments4f2da9daddress second bonk review round7fadefefix(build-id): write BUILD_ID once per build via closeBundle, not per-environment📊 Changes
4 files changed (+192 additions, -43 deletions)
View changed files
📝
packages/vinext/src/cloudflare/kv-cache-handler.ts(+1 -1)📝
packages/vinext/src/cloudflare/tpr.ts(+59 -29)📝
packages/vinext/src/index.ts(+50 -13)➕
tests/tpr-kv-keys.test.ts(+82 -0)📄 Description
Summary
uploadToKVwrote KV keys ascache:<pathname>but the runtimeKVCacheHandler.get()readscache:app:<buildId>:<pathname>:html— every TPR-seeded entry was a dead key (guaranteed cache miss)buildTprKVPairs()as an exported pure function that delegates key construction to the sharedisrCacheKey()fromserver/isr-cache.tsbuildIdfrom the prerender manifest (vinext-prerender.json) at upload time so keys include the build identifierBefore
Never matches → every TPR page is a cold miss.
After
Test plan
vp checkclean🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.