Advantages and disadvantages of SPA single page application

Advantages and disadvantages of SPA single page application

Advantages and disadvantages of SPA single page application

Single Page Web Application It is a special  Web application, all its activities are limited to one page, and the corresponding , , , and files are loaded Web only when the Web page is initialized . Once the page is loaded, it will not reload or jump the page, but use dynamic The default mode is to use anchor points to achieve routing and display and hide element components to achieve interaction. In short, the application has only one page. Usually, a multi-page application will have multiple pages constantly jumping, while a single-page application is always on one page. In , the default mode is to implement routing through anchors and control the display and hiding of components to achieve interaction similar to page jumps.HTML JavaScript CSS SPA JavaScript HTML Hash SPA Hash

Advantage

  • A good interactive experience, the content changes after the page is loaded for the first time does not need to reload the entire page, with faster response speed, the immediacy of desktop applications, and the portability and accessibility of websites.
  • A good front-end and back-end work separation mode, single-page applications can be used with RESTful the architecture, and by RESTAPI providing interface data, it helps to separate client and server-side work and API generalization.
  • To reduce the pressure on the server, the server does not need to deal with the logic and splicing of page templates. It only needs to provide data information except for the first loading of the page. The calculation should be placed on the client as much as possible. Single-page applications can increase the load of the unit server.
  • High maintainability, usually componentized and modular development, high code reuse, relatively high maintainability.

Disadvantage

  • The disadvantage SEO is that due to the method of front-end rendering, the search engine will not parse Js and can only crawl the unrendered template of the home page. If you need a better single-page application SEO, you usually need to use SSRserver-side rendering, and search engine crawlers will crawl The fetching tool can directly view the fully rendered page, but since it is the server-side rendering, it will put a certain pressure on the server, and the SSR server-side rendering is CPU intensive. Of course, if you only need SEOa few pages, you can use the pre-rendering method.
  • The first loading speed is slow. SPASingle-page applications usually load all the corresponding , , and files when the page is loaded for the first time HTML. JavaScript Usually CSS, it can be optimized by taking caching measures and lazy loading, that is, loading components on demand.

What's Your Reaction?

like
0
dislike
0
love
0
funny
0
angry
0
sad
0
wow
0