Advantages and disadvantages of single page Web application

Source: Internet
Author: User

First, the definition
A single-page Web application (single-page application is referred to as SPA) is a special Web application. It limits all activities to a single Web page, loading the appropriate HTML, JavaScript, and CSS only when the Web page is initialized. Once the page has been loaded, the spa will not reload or jump through the page because of user action. Instead, it uses JavaScript to dynamically transform the content of HTML to enable UI interaction with the user. The SPA provides a smoother user experience due to the avoidance of page reloading.

Ii. Advantages and Disadvantages

The advent of single-page Web programs is a corollary to the development of rich clients, but the technology is also somewhat limited, so it is necessary to understand the pros and cons before using it.

1. Advantages:

1). A good interactive experience

The user does not need to re-refresh the page, get the data is also asynchronously obtained through AJAX, the page display smooth.

2). Good front-end working separation mode

A single-page Web application can be used in conjunction with the RESTful protocol, providing interface data through the rest API, and using AJAX for asynchronous fetching, which helps to decouple client and server-side work. Further, the client can also be decomposed into static pages and page interaction two parts.

3). Reduce server pressure

The server only uses the data to be able, does not have the tube to display the logic and the page synthesis, the throughput ability will increase several times;

4). Share a set of back-end program code
Without modifying the backend program code can be used in the Web interface, mobile phone, tablet and other clients;
2. Disadvantages:

1). SEO Difficulty is higher

Because all the content in a page dynamically replace the display, so in the SEO has a natural weakness, so if your site on the SEO is very important, and to use a single page application, then do some static page for the search engine use it.

2). Forward and backward management

Because a single-page Web app displays all of the content on one page, you can't use the browser's forward and backward functionality, and all of the page transitions need to build up stack management yourself, but there's also a solution to this problem, such as using hash +iframe in URIs.

3). The initial load time is much longer

In order to realize the function and display effect of single page Web application, it is necessary to load the JavaScript and CSS uniformly when loading the page, and some pages can be loaded when needed. Therefore, the JavaScript and CSS code must be combined compression processing, if the use of third-party libraries, it is recommended to use some large companies CDN, so bandwidth consumption is inevitable.

Iii. Framework Angularjs
ANGULARJS is a mv* framework that is best suited for developing client-side single-page applications. It is not a library of functions, but a framework for developing dynamic Web pages. It focuses on extending the functionality of HTML, providing dynamic data binding, and it works well with other frameworks such as jquery.

If you're developing a single-page application, Angularjs is your top choice. Apps like Gmail, Google Docs, Twitter, and Facebook all have the ANGULARJS advantage. But applications such as game development that do a lot of manipulation of the DOM, or simply require very high speeds, are not angularjs.

Advantages and disadvantages of single page Web application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.