I am working on an application that sends an AJAX POST request (I'm currently using jQuery) every 1500 ms. I noticed that in most cases, these requests are executed within 350-450 ms and are sent to the server in the same order in which they are generated.
However, sometimes one or two requests take almost 3-4 seconds, and they are delivered later. In my application, I need to ensure that these requests are received by the server in the same order in which they were sent from the client. How should I do it? I am currently using 1500 ms setInterval to call a function (which generates data for publication) and which POST files use $ .ajax (). However, how do I serialize queries?
source
share