3 ms·
I can’t imagine a more suitable use case for a static site than for documentation. Why on earth?
by jammygit 7y ago
I can’t imagine a more suitable use case for a static site than for documentation. Why on earth?
- smt88 7y agoDocs can be really dynamic, like the ones that have runnable sample code in various languages. It's just that these docs... aren't.
- beatgammit 7y agoEven for those, it's completely reasonable to have most of the page be static and only have the runnable parts be dynamic. You could use React for the dynamic bits and regular HTML for the rest. Unfortunately, React typically takes over the whole page, so it's a little less straight forward.
- anchpop 7y agoI 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)
- pier25 7y agoHow is it surprising that rendering a React website is slower than simple HTML?
- robertoandred 7y agoAn SSR React site IS simple HTML.
- pier25 7y agoDoesn't matter, React has to rehydrate which blocks the CPU. SSR solves waiting for the API but not the CPU problem.
- robertoandred 7y agoThat doesn't affect TTFB.
- pier25 7y agoAh you are right, my bad. I was thinking of TTFI.
- anchpop 7y agoThe 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.
- tscangussu 7y agoBecause static sites are not cool anymore unless you use Gatsby and its GraphQL interface to read your markdown files, because directly read markdown from your disk is not cool either.
- robertoandred 7y agoWhy keep reading markdown from disk and regenerating the page when you can just compile the site once and be done with it? Much easier to cache.
- pier25 7y agoI think you missed the sarcasm from parent poster.