Why is it that after two consecutive requests, the second request is faster than the first one?

Why is it that after two consecutive requests, the second request is faster than the first one?
I have the same interface, such as parameter name=a for the first time and name=b for the second time.
two APIs request continuously. Normally, the one sent first should receive the response first, but the result is that the second one is faster than the first one.
Why is this?

Apr.13,2022

does not say that it must be in order. For speed, browsers generally establish more than one connection with the server


the speed of response is determined by the server. This problem should not be related to the front end


the sequence you mentioned is in the sequence of synchronization. The difference between them is very small, and the returned results are asynchronous. It has something to do with the network and the server. If you really want to test and set a long delay or set the request synchronization return, you can take a look at


the specific response speed depends on your server, not the first to return first.


No one stipulates that the first request comes first. That's the way the request is. It has something to do with the Internet and many other things.
take an analogy:
you have ordered two takeout orders An and B, and the rider An and B will deliver. When the departure time is about the same, it is hard to say which one will arrive first. The rider's cycling speed, the rider's choice of route, whether there are too many cars and people on the road, and no traffic jams are all factors that affect the rider's arrival time. Packets are constantly transmitted between different switches before they reach the client.
if you want to understand this knowledge, you can learn something about computer networks.

if you want to process requests sequentially at the front end, you can use Promise to avoid all kinds of nesting in callbacks.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b97c-2a7ef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b97c-2a7ef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?