-
Notifications
You must be signed in to change notification settings - Fork 176
Basic PPR #542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic PPR #542
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Is ppr
that easy to enable? Even if it's just a basic version.
Yeah we had already everything in place, so it was very easy (I thought it would be a little harder though, but not by much) The thing is, it's probably not worth it in a lot of cases. The S3 latency could make it totally worthless depending on what's prerendered. And you could end up paying a lot more, 1 S3 GET for every request instead of a few ms of a running lambda |
Hmm shouldn't those static assets be generated w/ |
We could add a cache layer between S3 and those assets, but that's just moving the problem. It still needs to be accessed by the server function itself, it cannot be served directly to the user. It is streamed and no CDN can cache only a part of the stream and request the rest from the origin ( At least for now ) Basically it does this: User request PPR route => Server Function Request Prerendered Part from S3 => Server starts the stream with the prerendered part => It appends SSR part to the existing stream That's why for me real PPR needs to be done at the CDN level, in workers you could cache the prerendered part directly in the CDN and start the stream right away |
I must not fully understand the PPR architecture. I assumed the static shell parts are determined at build time. Then when the client makes a request, it streams back the shell that points to the static asset, then continues w/ the suspense boundary stuff. I haven't dived into the source code to figure this out yet though. |
That's basically that. |
This PR add basic support for PPR.
This is the PPR built into next standalone, this mean that nothing can be served from the CDN (except the prefetched rsc).
The html are served from the server every time