DEV Community

Discussion on: What is the difference between these two ways of serving React App

Collapse
 
benjioe profile image
Benjioe • Edited

With the first (client-side rendering) you serve your project as JavaScript files. The browser has to interpret them to display the page.
With the second way (server-side rendering), your server generates HTML from your React and send it to the browser.

So the second way is more complex, but more performing who is better for SEO.

If you choose the second way, look at Next. JS, it helps a lot ;).

P.S: SSR is a little more complex than just rendering HTML. It could choose to send Javascript or Json to limit bandwidth usage.

Collapse
 
benjioe profile image
Benjioe • Edited

And there is a third way : Static Site Generation (jamstack) where you generate html from react when you deploy (at compile time).

Could be more scalable, more secure and have a better caching strategy, but you have to manage database changes.

Next.JS or Gatsby can help with that.