R
R
Roman2019-07-30 17:56:13
Frontend
Roman, 2019-07-30 17:56:13

How does Server Side Rendering work?

In modern front-end frameworks, it is possible to render the application on the server to improve performance. Let's say that in order to render a view, we need to get data asynchronously from the backend.
How does the SSR engine know to wait for all asynchronous requests to complete before rendering the content? Or will the engine not worry about it, but simply assemble the HTML representation according to the component tree, and the request for data and its rendering already falls on the shoulders of the client runtime?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2019-07-30
@xmoonlight

The server - prepares the HTML markup, and the front mechanism - simply arranges ready-made blocks, receiving them asynchronously.
includeHTML - this is how it works (including working with local files without using the server at all).
If there are dependencies on blocks, this is explicitly indicated during rendering (synchronization mode).

A
Anton Spirin, 2019-07-30
@rockon404

Different developers deal with this issue in different ways. Frameworks only provide an API for static rendering, and all architectural decisions fall on the shoulders of developers.
Perhaps you should look at ready-made solutions like next and nuxt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question