Server-side rendering

Server-side Rendering (SSR) consists of running and rendering the app on the server, before sending the HTML back to the browser. This has two main advantages:

  • Better Search Engine Optimization (SEO), since the initial content of the application will be rendered in the page HTML. This is important since no search engine is indexing an asynchronous JavaScript app (for example, when you have a spinner).
  • Slower networks or devices will display contents faster--the rendered HTML doesn't need the JavaScript to be shown to the user.

However, using SSR also brings some trade-offs:

  • The code need to be able to run on the server (unless it is in client-side only hooks such as mounted). Also, some libraries may not play well on the browser and may require special treatments.
  • The load will increase on the server, since it is doing more work.
  • The development setup is a bit more complex.

So using SSR isn't always a good idea, especially if the time the first content is shown isn't critical (for example, an admin dashboard).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.5.86