mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #777] [MERGED] fix: emit no-store Cache-Control for revalidate = 0 pages #836
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#836
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/777
Author: @NathanDrake2406
Created: 4/4/2026
Status: ✅ Merged
Merged: 4/4/2026
Merged by: @james-elicx
Base:
main← Head:fix/cache-control-revalidate-zero📝 Commits (1)
48354befix: emit no-store Cache-Control for revalidate = 0 pages📊 Changes
2 files changed (+80 additions, -4 deletions)
View changed files
📝
packages/vinext/src/server/app-page-response.ts(+20 -4)📝
tests/app-page-response.test.ts(+60 -0)📄 Description
Summary
export const revalidate = 0were not getting aCache-Controlheader, allowing CDNs to cache them0is falsy in JS — the RSC function usedif (options.revalidateSeconds)and the HTML function usedrevalidateSeconds > 0, both silently skipping the zero case=== 0checks in bothresolveAppPageRscResponsePolicyandresolveAppPageHtmlResponsePolicy, placed before any branch that would mishandle0as falsyisForceStatic/isDynamicErrorcondition in the HTML helper from(=== null || === 0)to=== null, removing the now-unreachable dead branchrevalidate = 0as equivalent todynamic = "force-dynamic"for caching: emitsCache-Control: no-store, must-revalidateTest plan
revalidateSeconds: 0in both RSC and HTML policy functions, includingisForceStatic: true+revalidateSeconds: 0combination to verify priority orderingpnpm run checkpasses🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.