4 ms·
I can't think of many cases where pre-rendering before the request is more advantageous than both completely static sites, and pre-rendering after the request.
by davidatbu 4y ago
I can't think of many cases where pre-rendering before the request is more advantageous than both completely static sites, and pre-rendering after the request.
I say this because most of the cases I can think of for dynamic websites would benefit from (or require) information about the currently logged in user, which is information only available when a request is made.
The only case I can think where JAMstack as we are defining it here would be a good fit is may be newspapers/magazines, where you'd perhaps like to make some API calls (to embed a tweet or whatever), but the content doesn't depend on the currently logged in user.
For that, and other reasons, I'm not at all convinced that JAMstack (or, tbh, I would like to call it pre-request-SSR) is an advantageous architecture in most cases. If anyone can point to blog posts by companies that have adopted JAMstack in production, and write about the tradeoffs they had to make and how that suited them, that would be great!
- leros 4y agoI think your analysis is fairly accurate. There are plenty of sites that are mostly static with some dynamic functionality injected in. JAMStack is great for those use cases. For fully dynamic applications, JAMStack may not be the optimal approach but it does work. I don't use SSR for my dynamic applications and it's not bad. The user downloads a static React app, the app pings Auth0 to see if they're logged in, and then the app fetches data from my server. That takes 100-200ms but that's totally acceptable for my use case. One downside to SSR is that you do need the server capabilities to handle whatever load gets thrown at your site.