Replies: 1 comment 1 reply
-
|
I think we’d need some real world benchmarks showing that removing streaming was actually faster in static builds and server requests. There are certainly some tempting things unlocked by this, but it’s a big architectural change so we should be confident we’re not accidentally shooting users in the foot, especially those working at scale/with high performance requirements. It would also be good to survey the patterns used by other successful frameworks to understand how they do things and what we can learn from them.
Might another option be to improve this behaviour potentially? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I propose removing support for streamed rendering in SSR, in order to improve performance and unlock a number of features.
Background & Motivation
Astro supports streams in on-demand rendering, which allows the server to start returning a response before every component has rendered. This can improve TTFB, and in some cases allow content to be displayed quicker. However it is not as powerful as in other frameworks that support streaming, because it does not support out-of-order rendering. This mean it just stops at the first component that has not resolved, which can leave the page in an arbitrarily partially-rendered state.
Some of the drawbacks of streaming:
Astro.responsecan only be modified at the page levelheadhas already been rendered when components are rendered, meaning it cannot have things such as preloads addedSome features that would be unlocked by removing streaming:
Astro.responsein any componentGoals
Non-goals
Beta Was this translation helpful? Give feedback.
All reactions