What are the bad effects of using too much javascript-ajax? How to solve?

Source: Internet
Author: User
In the development of background management system data comparison, the front end is used Ajax, too much, what harm? How to improve?

Reply content:

In the development of background management system data comparison, the front end is used Ajax, too much, what harm? How to improve?

The front-end basically does not io,ajax is the absolute main communication way.

Consider it, an AJAX is a request, too much of the request nature will affect performance, but Ajax if a one-time request for a lot of data to the page parsing is also very troublesome.
A page will definitely involve a lot of data, how to split the data, all aspects to consider, writing efficiency, UI interaction and so on.

In general, it depends on experience, how to do the minimum unit processing.

Magento2 a lot of use of Knockoutjs, a lot of data from Ajax, it will be a good reference.

The most common problem is the architectural design of large number of requests and local data refresh.

    • Ajax downloaded data should be cached and then retrieved after being notified.

    • How locally refreshed data does not affect data in other chunks.

The above problems need to have a more macroscopic architecture design to solve.

Did not feel the Ajax has what bad effect, have the question to let the spa how to live?

From the perspective of user interaction, Ajax benefits More, increasing user experience
Standing in the request concurrency angle, it is not good, but can also be resolved through the cache, of course, the server side will generally do.

Now the development of the background management system should not be all from JS route, do single page? Why is there an AJAX statement like that?

CSS Sprite (CSS Sprite) technology that fits multiple icons into one image is designed to reduce network requests.
It can be seen that reducing network requests improves performance on both sides of the browser and server.
Too much Ajax means more network requests, and obviously too much is bad.
But Ajax with some background page, the message notification, the experience is still good.

If it is a front-and-back separation, Ajax is a key way to communicate, you have to deal with the asynchronous control process of Ajax

  • Related Article

    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.