mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #320] [MERGED] feat: support export const revalidate on App Router GET route handlers #478
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#478
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/320
Author: @NathanDrake2406
Created: 3/7/2026
Status: ✅ Merged
Merged: 3/7/2026
Merged by: @james-elicx
Base:
main← Head:feat/route-handler-revalidate📝 Commits (3)
302fe2bchore: add .worktrees/ to gitignore538d598feat: supportexport const revalidateon App Router GET route handlersb602397fix: guard revalidate=0 and add proper test fixtures📊 Changes
6 files changed (+67 additions, -5 deletions)
View changed files
📝
.gitignore(+3 -0)📝
packages/vinext/src/server/app-dev-server.ts(+7 -0)📝
tests/e2e/app-router/api-routes.spec.ts(+4 -5)➕
tests/fixtures/app-basic/app/api/custom-cache/route.ts(+12 -0)➕
tests/fixtures/app-basic/app/api/no-cache/route.ts(+9 -0)📝
tests/nextjs-compat/app-routes.test.ts(+32 -0)📄 Description
Summary
export const revalidate = Nfrom route handler modules in the App Router dev serverCache-Control: s-maxage=N, stale-while-revalidateon GET responses when the handler doesn't set its own Cache-Controltest.fixmecases for route handler cache headers (ported from OpenNext)app-routes.test.tsfor header emission and no-override behaviorCloses the behavioral gap where vinext ignored route segment config on route handlers, only reading it from page modules.
Test plan
pnpm test tests/nextjs-compat/app-routes.test.ts— 25 tests pass (2 new)pnpm run typecheck— cleanpnpm run lint— cleanapi-routes.spec.ts"Route Handler Cache Headers" describe block (2 unskipped tests)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.