The earliest days of the Web
If you want to present dynamic web pages, before the earliest time can only SSR. The server renders the data plus HTML into a complete Web page and sends it to the front end. The Web at this point is simply a presentation of information.
Interactive Web
And then I realized that it’s not enough to have data, it needs to be interactive. Interactive work to JS to complete, this period of the server in addition to reading data back end code, but also mixed with a lot of JS code.
Separated web
The back end with JS code is not conducive to maintenance, and the separation of the front and back end code has become everyone’s voice. (The server to do a large amount of data rendering calculation is also a waste of server resources) and the front and back end code separation needs to face a problem is the problem of data communication, back-end dynamic data transmission to the front end. This was when Ajax (and later FETCH) was introduced to asynchronously request data and make browsing a smoother experience for the user. Ajax not only solves the problem of data communication and enables front-end separation (front-end parallel development), but also enhances the user experience (asynchronous loading).
SPA appears
The extreme of interactive experience and the rise of various mobile terminals, SPA began to emerge. SPA is close to Native App, except the problem of slow first loading (this depends on how to implement, there are also solutions to avoid slow first loading). Subsequent operations do not need to refresh the entire page, but only update some components. Users feel faster and experience better.
SPA problems
SPA brings SEO and slow first loading issues.
Server side to render the interactive Web.
The server-side rendering at this point is different from the server-side rendering of the past. In the past, server-side rendering only wanted to dynamically display data on a web page. Regardless of the interactivity of the Web, the implementation is done by people on the back end. But here’s the thing: not only do we need an interactive Web, but the Web application is generated by the back end. And it must be separated from the front and back end, there can be no code jumbled. Also, the SSR implementation is done by the front end personnel.
The wheel of history feels like it's turning back, but with a completely different meaning. Technology is like a spiral.Copy the code