What are the differences between client-side and server-side "rendering"?

7

Lately I've seen a lot of the term server-side rendering , mainly with the popularization of some frameworks and libraries, but I still can not understand what improvements this can bring to a system.

I would like to know the differences between these two types of renderings and also the pros and cons of them.

    
asked by anonymous 05.06.2017 / 18:48

2 answers

3

Rendering Server Side

The server processes the requested data, generates the page and transmits the HTML-ready page to the client. The browser reads the HTML and "draws" the page to the person.

Pros:

  • The server is a machine with large processing capacity and the largest processing is on the server
  • Customer does not have to worry too much about data processing, just by receiving and displaying the page itself.

Cons:

  • All ready page must be transmitted via network / internet. This increases bandwidth usage.
  • Whenever processing is required, the client calls the server which does the whole process again, generating a new page on the server that will be relayed entirely to the client. Such a process requires more network / internet bandwidth.

Rendering Client Side

The client sends request of the desired data and renders the page by itself. Only the data is received, the client has the job of generating the page to be displayed in the browser.

Pros :

  • It is not necessary to transfer the entire page via network / internet with each change. Only new data is transferred.
  • Do not overload the server so much in case of many clients.

Cons

  • Increases client-side processing, perhaps requiring a better machine on clients. Changing the page by the client is a procedure that naturally spends a lot of resources. Overuse causes too slow.
  • Client-side applications (javascript) expose the client application code.

Personal opinion

In my opinion, the interesting thing is to initially generate the first page on the server side and the changes / updates generate on the client side.

    
05.06.2017 / 20:20
4

This is about who mounts the content to display.

If it is on the server it obviously has all the work of putting together text that will be the page to be delivered to the client essentially ready for use.

If it is on the client, a set of page plus miscellaneous codes will be received by the client and from there it will only communicate with the server to request new information that it needs, everything that needs to modify and adapt in the presentation of the page occurs in the client even.

There are hybrid cases.

Obviously drawing everything on the client may slightly unload the need for the server to work. In theory, because depending on the case making multiple requests alone can generate so much load that it can be worse than rendering on the server. Not to mention that the developer can do everything wrong and make things worse.

Rendering on the client can bring more insecurity, breach of privacy, piracy of the code. Of course most of these things can be solved with some work.

Rendering on a client does not usually go very well with SEO, even if some people believe that it does not have a problem, that is, it's not very good for websites. It works better and has more advantages in web applications that are very different.

As unbelievable as it sounds, there is not as good control rendering on the client, at least in the current state of technology.

  

I need to leave, I'll finish later.

    
05.06.2017 / 19:36