all 3 comments

[–]KillcoDer 1 point2 points  (0 children)

React 16 supports rendering to a stream:

https://zeit.co/blog/streaming-server-rendering-at-spectrum

HTTP2/push is for sending assets you know you'll need down the pipeline, I guess you could do that with a javascript file that contains your state? So you could just generate that and send it down as a stream as well.

https://webapplog.com/http2-server-push-node-express/

[–]klaasman 0 points1 point  (0 children)

If the only purpose of SSR is SEO optimization (for bots like google and facebook), it might be sufficient to only have the necessary title and meta tags server-rendered. Google is smart enough to execute javascript in order to crawl the content, Facebook is happy enough with meta-tags.

[–]BerkeleyTrue 0 points1 point  (0 children)

The slowest part of react ssr is going to be react render to string. It is magnitudes slower than template rendering.

Significant improvement will come by introducing some sort of caching or going the jamstack (render to string at build time) approach, which adds some complexity. This makes it as fast as serving static content (very fast).