0
votes

I understood it was ssr when I first loaded the Nuxt.js. But I don't understand how loading a page with ssr and using it with csr works. Also, I wonder if asyncData works only when it is operated by csr. How does the Nuxt.js work?

1
When you referred to csr what you mean? It's not clear what you mean.KodeFor.Me

1 Answers

0
votes

The main difference between SSR (Server side rendered) and CSR (Client side rendered) is, that with SSR your servers response to the browser is the HTML of your page that is ready to be rendered, while for CSR the browser just gets an empty document with links to your Javascript.

Getting a server generated page means that your browser will start rendering the HTML from your server without having to wait for all the JavaScript to be downloaded and executed.

Nuxt.js is using genrating a SSR page just for the first load (which speeds up to initial load time, and has some more advantages). Once all the Javascript is loaded, Nuxt.js mounts the original Vue app, which will make everything reactive, apply the routing etc.