Multiple ajax requests, resulting in slow initialization of the screen. Is there a solution?

Web developer, there is a screen that uses 5 ajax requests. The screen finally shows that it will take a long time.
I would like to ask what the solution is.
I have always wondered how so many pictures and other information can be loaded quickly on shopping sites like taobao.
I don"t have much development experience, so I have a great god to explain it in detail.
Thank you

Jul.28,2021

too little information can only be guessed. Maybe the back-end interface is slow. If it is pc, in fact, there should be no slow style can not come out of the situation. So this is more likely to happen on the move. So if it is not necessary to split five interfaces, you can ask the back end to merge the interfaces into one, and the front end caches all the data for subsequent processing. In the case of slow interfaces, the front end cannot be handled and can only be optimized by the back end. And the front end can do the corresponding dom loading with html will sequentially load the styles and scripts in the file. Then the style is best placed in the head, at the top of the page, and the script at the bottom, in front of the body closing tag. Because pages are loaded sequentially from top to bottom. On the other hand, the running of the script will be relatively blocked, and it is possible that the script error will directly kill the page. The minimum style at the bottom will be loaded first, at least so that the user can see something. Or add a loading effect ajax to end and then close the loading. Then optimize your own style script as much as possible. This is just what the front end can do. The final solution still needs the back end to optimize the interface.


first of all, the problem of slow backend interface should be eliminated.
then know that browsers have concurrency restrictions on requests for the same domain name, usually 6 concurrency, this request includes static resources such as images.
so there can be two solutions:
1. Assign static resources to different secondary domain names
2. Use https2.0

Menu