You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rocket already supports file streaming, but template streaming would also be a valuable tool for application developers.
Template streaming allows the server to stream HTML as it's generated, so that the browser is able to parse & render it earlier than it otherwise would.
The most likely slowdown for page rendering is expensive / poorly optimized database queries. This allows the browser to eagerly load assets and render page navigation elements while the server is finishing up the actual content of the page. This optimization is especially important for mobile users, because network latency can easily add 5 seconds to page render time (especially if the page requires JS).
Template streaming is supported by Rails, and Django users have found hacky solutions to get similar behavior.
It seems that there are two possible implementations:
update the template rendering libraries to return an iterator
have the application developer wrap certain parts of the HTML in a closure, communicating that the server can now pause to send all previous HTML to the browser
this is what Rails does, with closures passed to provide
The text was updated successfully, but these errors were encountered:
Moving to async (see #17) should be make this easy to implement, assuming support from templating engines. Because #17 covers the former, and because generally Rocket does not itself provide a templating engine, I'm closing this out.
Rocket already supports file streaming, but template streaming would also be a valuable tool for application developers.
Template streaming allows the server to stream HTML as it's generated, so that the browser is able to parse & render it earlier than it otherwise would.
The most likely slowdown for page rendering is expensive / poorly optimized database queries. This allows the browser to eagerly load assets and render page navigation elements while the server is finishing up the actual content of the page. This optimization is especially important for mobile users, because network latency can easily add 5 seconds to page render time (especially if the page requires JS).
Template streaming is supported by Rails, and Django users have found hacky solutions to get similar behavior.
It seems that there are two possible implementations:
provide
The text was updated successfully, but these errors were encountered: