Skip to content

SmooaiNextEdge: include Next.js RSC headers in HTML cache key (0.1.6)#5

Merged
brentrager merged 1 commit into
mainfrom
fix-rsc-cache-key
Jun 12, 2026
Merged

SmooaiNextEdge: include Next.js RSC headers in HTML cache key (0.1.6)#5
brentrager merged 1 commit into
mainfrom
fix-rsc-cache-key

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Live bug from smoo.ai's apex cutover. The HTML cache policy used headerBehavior:'none', so CloudFront collided the HTML document and the RSC/Flight payload (same URL, differentiated only by the RSC header) — a cached RSC payload got served as the document, pages rendered as raw text and never hydrated (forms dead, sign-in 'did nothing'). Fix: whitelist RSC/Next-Router-Prefetch/Next-Router-State-Tree/Next-Url in the cache key (same as OpenNext/sst.aws.Nextjs). Bumps to 0.1.6. 🤖 Generated with Claude Code

…1.6)

The HTML cache policy used headerBehavior:'none', so CloudFront cached the HTML
document and the React Server Component (RSC/Flight) payload for the SAME URL
under the SAME key — Next.js serves both at one URL, differentiated only by the
`RSC` request header. A cached RSC payload then got served for a document
request: pages rendered as raw text (`1:"$Sreact.fragment"…`), never hydrated,
forms were dead, sign-in "did nothing". Hit live on smoo.ai's apex cutover.

Whitelist RSC / Next-Router-Prefetch / Next-Router-State-Tree / Next-Url in the
HTML cache key so the document and each RSC variant get distinct entries (same
set OpenNext / sst.aws.Nextjs use). Bumps @smooai/deploy -> 0.1.6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 131b10b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@brentrager brentrager merged commit aae7eb9 into main Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant