[PR #419] [MERGED] fix(isr): namespace cache keys by buildId #557

Closed
opened 2026-05-06 13:08:45 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/419
Author: @Divkix
Created: 3/10/2026
Status: Merged
Merged: 3/10/2026
Merged by: @james-elicx

Base: mainHead: fix/isr-cache-key-buildid


📝 Commits (7)

  • fafdd02 fix(isr): namespace cache keys by buildId
  • 7fbe420 test: update pages-server-entry snapshot for buildId cache key
  • b6ff058 fix(isr): inline isrCacheKey with fnv1a64 hashing in pages server entry
  • 2b794f6 Merge remote-tracking branch 'upstream/main' into fix/isr-cache-key-buildid
  • cc54630 address review: clarify __VINEXT_BUILD_ID is undefined in dev by design
  • 9b7608a address review: align app-rsc-entry ISR key format with pages router, add comments
  • de45533 address review: clarify keep-in-sync comment scope (prefix/hashing, not full key format)

📊 Changes

6 files changed (+160 additions, -39 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+9 -4)
📝 packages/vinext/src/entries/pages-server-entry.ts (+26 -3)
📝 packages/vinext/src/server/dev-server.ts (+14 -2)
📝 packages/vinext/src/server/isr-cache.ts (+4 -3)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+80 -27)
📝 tests/isr-cache.test.ts (+27 -0)

📄 Description

Summary

  • Include buildId in ISR cache key generation to prevent stale cache reuse across deploys
  • Key format changes from <router>:<pathname> to <router>:<buildId>:<pathname> when buildId is available
  • Backward compatible: without buildId, key format is unchanged
  • Updated all callers: dev-server.ts, pages-server-entry.ts

Closes #415

Test plan

  • Unit tests for isrCacheKey() with and without buildId
  • Long path hashing still works with buildId prefix
  • Backward compatibility: no buildId = old format
  • Typecheck, lint, format pass

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/419 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 3/10/2026 **Status:** ✅ Merged **Merged:** 3/10/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/isr-cache-key-buildid` --- ### 📝 Commits (7) - [`fafdd02`](https://github.com/cloudflare/vinext/commit/fafdd026aa2e6627738c92cfc7c13047dad8d733) fix(isr): namespace cache keys by buildId - [`7fbe420`](https://github.com/cloudflare/vinext/commit/7fbe4209501f6b107f1110a3e8c046822af5906e) test: update pages-server-entry snapshot for buildId cache key - [`b6ff058`](https://github.com/cloudflare/vinext/commit/b6ff05857ee82b2926905a648ef5821a825d8dbb) fix(isr): inline isrCacheKey with fnv1a64 hashing in pages server entry - [`2b794f6`](https://github.com/cloudflare/vinext/commit/2b794f609ce31b046e7217c0cb5c4f157c060118) Merge remote-tracking branch 'upstream/main' into fix/isr-cache-key-buildid - [`cc54630`](https://github.com/cloudflare/vinext/commit/cc546300f99bab780ca2ad1f4d29f3ba5cbe2103) address review: clarify __VINEXT_BUILD_ID is undefined in dev by design - [`9b7608a`](https://github.com/cloudflare/vinext/commit/9b7608aebf0f2178e70775b7ebe294fc7bdaea62) address review: align app-rsc-entry ISR key format with pages router, add comments - [`de45533`](https://github.com/cloudflare/vinext/commit/de455332f71dcda9c0275650ee416c429f8f29ff) address review: clarify keep-in-sync comment scope (prefix/hashing, not full key format) ### 📊 Changes **6 files changed** (+160 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+9 -4) 📝 `packages/vinext/src/entries/pages-server-entry.ts` (+26 -3) 📝 `packages/vinext/src/server/dev-server.ts` (+14 -2) 📝 `packages/vinext/src/server/isr-cache.ts` (+4 -3) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+80 -27) 📝 `tests/isr-cache.test.ts` (+27 -0) </details> ### 📄 Description ## Summary - Include `buildId` in ISR cache key generation to prevent stale cache reuse across deploys - Key format changes from `<router>:<pathname>` to `<router>:<buildId>:<pathname>` when buildId is available - Backward compatible: without buildId, key format is unchanged - Updated all callers: `dev-server.ts`, `pages-server-entry.ts` Closes #415 ## Test plan - [ ] Unit tests for `isrCacheKey()` with and without buildId - [ ] Long path hashing still works with buildId prefix - [ ] Backward compatibility: no buildId = old format - [ ] Typecheck, lint, format pass --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:08:45 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#557
No description provided.