|
|
|
|
|
by orhanhenrik
3600 days ago
|
|
I have not looked at how this framework does it, but I have built a nodejs server that does similar things myself.
Some advantages: - The server can render the full page in html for the client, which means the website is viewable even without js (or before js has loaded, for example on slow network) - The server can preload all data the client needs. The webapp might need to fetch data from 3 API endpoints. Having a server do this and pass the results to the client on load is much more efficient. If the client (browser) loads it, the following happens: html loaded -> js loaded -> start calling APIs. If the server does it, the client instantly has access to this data. Rendering all the html can be a bit heavy on a weak server though, but you get the advantage that you quickly notice bottlenecks in your rendering. You can also implement some caching on your server to make it faster. |
|