Guidance needed for configuring Next.js 15 streaming with Fastly CDN #81676
Unanswered
adardesign
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
We are adopting Next.js 15 to leverage its server-side streaming capabilities with React Suspense. While streaming works perfectly in our local development environment, we are encountering issues when deploying our application behind Fastly CDN.
The Problem
When a page with Suspense boundaries is requested through Fastly, the response appears to be fully buffered. Instead of the initial shell being sent immediately followed by streamed chunks, the browser only receives the complete HTML document after the slowest data fetch has resolved on the server. This behavior negates the primary user experience benefit of streaming.
Expected Behavior
We expect Fastly to act as a pass-through for the streamed response from the Next.js server. The initial HTML shell should be delivered to the client instantly, and subsequent chunks generated by resolved Suspense boundaries should be sent as they become available, without being buffered by the CDN.
Our Setup
What We've Tried
set beresp.do_stream = true;
withinvcl_fetch
for responses from our Next.js origin.Transfer-Encoding: chunked
.Request for Guidance
Could the team provide official documentation or guidance on the recommended configuration for using Next.js streaming with a streaming-capable CDN like Fastly?
Specifically, we are looking for answers to the following:
Any insights or examples would be immensely helpful for us and likely for other users in the community deploying Next.js in similar enterprise environments.
Thank you for your time and for building a great framework.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions