


javascript - What are the adverse effects of using too much Ajax? How to deal with it?
When comparing data in the development backend management system, AJAX is used on the front end. If it is used too much, what are the disadvantages? How to improve?
Reply content:
When comparing data in the development backend management system, AJAX is used on the front end. If it is used too much, what are the disadvantages? How to improve?
There is basically no io on the front end, and ajax is the absolute main communication method.
Thinking it all together, an ajax is a request. Too many requests will naturally affect performance. However, if ajax requests a lot of data at once and parses it on the page, it will also be very troublesome.
A page will definitely involve a lot of data. How to divide this data must be considered in all aspects, including writing efficiency, UI interaction, etc.
In general, it still depends on experience and how to do the smallest unit processing.
magento2 uses knockoutjs extensively, and a lot of data comes from AJAX. It will be a good reference.
The most common problems are the architectural design of large number of requests and partial data refresh.
The data downloaded by AJAX should be cached and will be retrieved again after being notified.
How can the locally refreshed data not affect the data of other blocks?
The above problems require a relatively macro-architectural design to solve them.
I don’t feel that Ajax has any adverse effects. If there is a problem, how can the SPA survive? .
From the perspective of user interaction, AJAX has more benefits and improves user experience.
From the perspective of request concurrency, it is not good, but it can also be solved through caching. Of course, the server side usually does it as well.
Shouldn’t all the backend management systems being developed now be routed by js and be a single page? Why is there still such a thing as ajax?
The CSS Sprite (CSS sprite) technology that combines multiple icons into one image is actually to reduce network requests.
It can be seen that reducing network requests can improve the performance of both the browser and the server.
Too much AJAX means network There are more requests, and obviously too many are bad.
But when AJAX is used for some background page turning and message notifications, the experience is still good.
If it is separation of front and back, ajax is a key interactive communication method. What you have to deal with is the asynchronous control process of ajax

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

In PHP, you can effectively prevent CSRF attacks by using unpredictable tokens. Specific methods include: 1. Generate and embed CSRF tokens in the form; 2. Verify the validity of the token when processing the request.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

"h5" and "HTML5" are the same in most cases, but they may have different meanings in certain specific scenarios. 1. "HTML5" is a W3C-defined standard that contains new tags and APIs. 2. "h5" is usually the abbreviation of HTML5, but in mobile development, it may refer to a framework based on HTML5. Understanding these differences helps to use these terms accurately in your project.

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.
