Atlas 4: Only 2 calls at a time and don't expect any order

Browsers make 2 concurrent AJAX calls at a time to a domain. If you make 5 AJAX calls, browser is going to make 2 calls first, then wait for any one of them to complete and then make another call until all remaining 4 calls are complete. Moreover, you cannot expect calls to execute in the same order as you make the calls. Here's why:

Here you see, call 3's response download is quite big and thus takes longer than Call 5. So, Call 5 actually gets executed before Call 3.

So, the world of HTTP is unpredictable.

Published Sat, Sep 23 2006 17:37 by omar
Filed under: