Re:MDN (beta) is now built with React
by anchpop on Tuesday July 16, 2019 @12:54PM
(#20451736)
I find react to be a very pleasant way to make websites, even static ones. And for static sites you can use SSR or something like GatsbyJS to make everything load as if you had actually written the html (i.e. no dependence on javascript). That's the approach I use for my blog and according to google pagespeed the only problem with it is that the TTFB is too high (which is surprising because I host it as a totally static site on AWS)
[ Parent
| on HN ]
How is it surprising that rendering a React website is slower than simple HTML?
The server doesn't do any rendering before serving the page. All the "SSR" is done exactly once at build time. To the server it's no different from serving any other site.
I'm not too familiar with Gatsby but something has to be slowing you down if TTFB is too high.
It's not that high, Google says I might be able to save .8 seconds. I might try hosting on netlify and see if that improves things
Re:MDN (beta) is now built with React
by robertoandred on Tuesday July 16, 2019 @03:32PM
(#20453121)
An SSR React site IS simple HTML.
Doesn't matter, React has to rehydrate which blocks the CPU.
SSR solves waiting for the API but not the CPU problem.
Re:MDN (beta) is now built with React
by robertoandred on Tuesday July 16, 2019 @04:59PM
(#20453850)
That doesn't affect TTFB.