Static GitHub Issues

[302] I'm confused when to use server side rendering vs generate

prev: Cache component is not work?
next: global layout variable

Nuxt generate is so easy! But there must be downsides. Do you have some example scenarios of when server rendering is the better choice?

I'm not really sure how generate works. If you....

  • make an a call to /api/users/index
  • v-for users as user {{ user.name }}

Does this api call and render happen on the server? Or on the client? The quote below makes me think answer is both

every time a product is out of stock or back in stock, we regenerate the web app. But if the user navigates through the web app in the meantime, it will be up to date thanks to the API calls made to the e-commerce API. No need to have multiple instances of a server + a cache anymore!

I was also reading pre-render vs srr information in this readme https://github.com/chrisvfritz/prerender-spa-plugin

Can dynamic content pages like /my-profile be ignored by nuxt generate? Could requesting url /my-profile directly 404 or redirect, but navigating via login -> menu -> my-profile fetch the data from api?

Are all these possible with nuxt generate? If so, then when is server side rendering better?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c258">#c258</a>)</em></sub></div>