-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Description
Problem
ISR cache keys are currently formatted as <router>:<pathname> (e.g., pages:/about). When a new version of the app is deployed, the old cached entries may be served because the cache key hasn't changed. This can cause stale content from a previous build to be served to users.
Proposed Solution
Include buildId in the ISR cache key format: <router>:<buildId>:<pathname>.
The buildId is already available at runtime via process.env.__VINEXT_BUILD_ID (injected by the Vite define plugin). The change is to pass it through to isrCacheKey() and include it in the generated key.
This ensures that each deployment gets its own cache namespace, preventing stale cache reuse across deploys.
Acceptance Criteria
-
isrCacheKey()accepts optionalbuildIdparameter - When
buildIdis provided, key format is<router>:<buildId>:<pathname> - Without
buildId, format is unchanged (backward compat) - Long paths with
buildIdstill hash correctly when exceeding length limit - All callers updated:
dev-server.ts,pages-server-entry.ts - Tests cover all cases
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels