[Vue17] single-page and multi-page applications

Intro:   Multi-page applicationEach time a page jumps, the background server returns a new html document, a type of site that is also known as a multi-page site, also known as a multi-page application.The firs

Multi-page application

Each time a page jumps, the background server returns a new html document, a type of site that is also known as a multi-page site, also known as a multi-page application.

The first screen time is called the time when the content of the first screen of the page is displayed. When we visit the page, the server returns a html, page and shows it. This process goes through only one HTTP request, so the page is displayed very fast.

When the search engine does the web page ranking, it is necessary to give the web page weight according to the web page content, to carry on the web page ranking. Search engines can recognize html content, and all the content on each of our pages is placed in Html, so this multi-page application, seo ranking effect is good.

Because each jump requires an http request, if the network is slow, the obvious Catton will be found when jumping back and forth between pages.

Single page application

The first time you enter the page, a html file is requested and refreshed and cleared. Switch to other components, and the path changes accordingly, but there is no new html file request and the content of the page changes. The principle is: JS will sense the change of url, through this, you can use js to dynamically clear the content of the current page, and then mount the content of the next page to the current page, this time the route is not the back end to do, but the front end to do, determine which component the page is displayed, clear the unnecessary, display the required components. This process is a single-page application, and there is no need to request html files every time you jump.

Every time the page switches and jumps, there is no need to make the request of the html file, which saves a lot of http sending delay, and we are very fast when switching the page.

The first screen of a single-page application is slow, the first screen needs to request a html, at the same time send a js request, two requests come back, the first screen will be displayed. Compared with multi-page applications, the first screen time is slow. The effect of SEO is poor, because the search engine only knows the content in html, does not know the content of js, and the content of single-page application is generated by js rendering, the search engine does not recognize this part of the content, it will not give a good ranking, which will lead to the poor ranking of the web page made by single-page application in Baidu and Google.

Vue also provides a number of other technologies to address these shortcomings, such as server-side rendering technology (I am SSR), can solve these shortcomings perfectly through these technologies, solve these problems, in fact, single-page applications are the perfect page development solution for the front end.

New updates

Written since July 16, 2018, recently in the transformation of the company’s project, the company’s project is a single-page application, may be changed to a multi-page app, so take a look at this again. I saw a form on the Internet and felt that the summary was very good and posted it. The source is here: I am the source of the form summary.

Related Passages:

Leave a Reply

Your email address will not be published. Required fields are marked *