The difference between the front end and the rear end route route

1. What is routing

  Routing is to show different content depending on the page or url address;

2. What is the front-end routing?

  It is important that the page does not refresh, front-end routing is to route different tasks corresponding to different content or pages to do the front-end, each jump to a different URL anchors are using front-end routing. With (SPA) the growing popularity of single-page application, separating the front and rear side development, the current project basically a front-end routing, during the project using the page will not reload.

3. What is the back-end routing?

       When the browser switch to a different url in the address bar, every issue to the back-end server request, the server responds to the request passed to splice html file in the background the front view, return to a different page, it means that the browser will refresh the page, network speed slow, then maybe an all-white screen and then there's something new. Another big problem is that the rear end of the front and rear ends of the route are not separated.

       Advantages: shouldering a front end, html data and splice is completed by the server.

       Disadvantages: When the project is very large, increasing the pressure on the server side, but can not enter the url path to develop access to a specific module in the browser. Another is if the current speed is too slow, it will delay loading the page, the user experience is not very friendly.

4, when using the front-end routing?

       In the single-page application, most of the page structure constant, changing only some of these items

5, front-end routing What are the advantages and disadvantages?

advantage:

        1. a good user experience, speed and background does not matter, do not need to always get from the server all the fast show to the user

        2. You can then enter the url address to specify the path you want to access the browser.

        3. To achieve a separation of the front and rear ends, to facilitate development. There are many frameworks with routing module.

 Disadvantages:

        1. Use your browser's forward and backward when the key will re-send the request, there is no rational use of cache

        2. A single page can not remember scroll position before, not in forward, backward remember when scrolling position

Guess you like

Origin www.cnblogs.com/wuyunna/p/11496430.html