3 ms·
Yeah, that's definitely a non-standard use of "static". If I can't just point my browser to a local index.html sitting in a folder somewhere, it isn't a static
by MereInterest 7y ago
Yeah, that's definitely a non-standard use of "static". If I can't just point my browser to a local index.html sitting in a folder somewhere, it isn't a static webpage.
- MaxBarraclough 7y agoBut that's the point, an SPA could well meet your definition. An SPA could take the form a single index.html file and make use of APIs + JavaScript, rather than pages generated dynamically by the server.
- zozbot234 7y agoI'm pretty sure that API responses are generated dynamically by the server. Is there really that big of a performance impact server-side between "rendering" full HTML vs. generating JSON?
- MaxBarraclough 7y agoIf the JavaScript is small and efficient, I would guess the overhead is little more than the extra roundtrip that you'd avoid if you just delivered the HTML pre-baked. A slight aside: Dynamically producing HTML (avoiding client-side JavaScript) is now back in vogue with a rather silly buzzword: server-side rendering. Presumably coined by someone who doesn't understand what 'render' means. https://alligator.io/react/server-side-rendering/ https://alligator.io/react/server-side-rendering/
- MereInterest 7y agoHmm, good point. I think I would add that for it to be a static site, it must also be fully functional when there is no network access. A SPA that, for example, generates the Mandelbrot set and displays it, would fit this definition. A SPA that asks google for stock prices and displays them would not be, because there is additional data being requested outside of the static files served.