V
V
vaskadogana2017-04-05 11:53:45
Frontend
vaskadogana, 2017-04-05 11:53:45

Why use server-side rendering? What are the advantages of rendering on the server?

I just can't figure out what the point of rendering on the server side is.
My view of the situation (purely my conclusions, since I didn’t find any reasoned information for what, I stumble only on manuals - "step by step instructions") :
pluses:
- we give the client ready (rendered) content, (but it seems like the client is now quite powerful hardware, and where it’s weak, the react still won’t go due to outdated software)
- the application is given in fragments (it seems like the interaction is faster, due to the speed of receiving data)
cons:
- consumption of extra server resources (as far as I understand, for each client the required component is compiled from the sources)
- a large response timeout (I think so if there is a lot of parallel rendering processes with good traffic. Or am I misunderstanding about rendering?)
- there is no possibility of caching data on the client (after all, a new component render with each request)
- unnecessary requirements for the code during development (the classic redux storage seems to no longer work, you need to make sure that the data does not disappear when you navigate through the pages.
ps I am attracted by the ability to give the application in parts, but the disadvantages I have listed are annoying.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vahe, 2017-09-12
@vahe_2000


By the way, very good question.
You need with Bing, Yahoo or Baidu, Google.
You already have a running application that requires maximum performance and is willing to pay for additional server resources.
Server resources are limited, perhaps due to low budget or inability to scale.
SSR is very cool, but in some cases it has disadvantages.
Once the browser has loaded the HTML and CSS, it can display the rendered components to the user without waiting for the JavaScript to load or the render to react.
If the JavaScript file is very large, this can be a big improvement.
The web page won't be interactive until the JavaScript loads and responds to load scripts, but perceived performance still improves as the user sees the content faster.
SSR is more work for your server, so your HTTP response will take a little longer to return. Much longer if your servers are under heavy load.
The size of your HTML will be increased and take longer to load. For most applications this should be negligible, but can be a factor if your REACT components contain long lists or tables.
When a single user loads multiple pages on your site or returns frequently, your JavaScript file should be cached. SSR will provide less of a performance boost in this situation.
We cannot say if performance is better with SSR or performance is worse with SSR. In general, no statement will be true to say that ssr is good
use zeit/now with zeit/next.js you
probably heard or tried

S
sim3x, 2017-04-05
@sim3x

The client is a search bot that understands only html
The client is a mobile phone with a weak Internet, it does not have enough resources to pass all the logic through itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question