Front and rear ends of collaboration - server and render the separation of the front and rear end

Cooperation is divided into before and after the end of two ways: 1 server 2. Render the front and rear ends of the splitter

1. Server Rendering (SSR)

   Client request, the servlet server or controller receives the request, the back-end control routing and rendering the page, call the service, dao business logic code completion, return jsp, jsp show page.

 

tips: 

       servlet in the server applet running on. The word is in the Java  applet to create an environment, Java applet is a small program as a separate file sent along with pages, it is usually used to run on the client, the results were for the user or operator interactions based on user location graphics and other services. (From Baidu Encyclopedia)

       MVC controller is in the controller.

       dao backend data access layer.

2. The front end of the separation

  The browser sends a request directly to the html page, the page is responsible for calling the server port to generate data, padding html, parsing operation on the page DOM

 

Difference between the two:

Transmission volume:

    Rendering more server data transmission, and a lot of duplicate data.

    A small amount of data transmission separated front and rear ends

transfer data:

    HTML rendering server returns

    Front and rear ends of the separated data returned JSON format

control:

    Rendering backend server is determined by the majority

    Separation of the page from front and rear ends, the front end determined by

SEO:

    Server rendering support SEO

    Before and after the end of the separation does not support the SEO, because the first screen rendering of html was empty data

user experience:

   Rendering server returns a page that contains data and HTML, the first screen to load faster

   There are front and rear end of the separation process of the rendering data, rendering first screen load times longer, single-page application (SPA), a better user experience

For developers: 

   Server rendering the background pressure, the phenomenon of bug there will pass the buck, the server-side pressure.

   Separating the front and rear ends of the front and back-office roles, who appeared quickly locate the bug causes less stress on the server side, the front page a large number of data can be loaded asynchronously. Improve development efficiency. Front-end code, can be reused, component. Enhance the development efficiency.

Guess you like

Origin www.cnblogs.com/JiAyInNnNn/p/10959179.html