Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVC + jQuery + IIS6: Multiple Ajax requests
    primarykey
    data
    text
    <p>I'm not sure where the problem is...</p> <p>I have an ajax request that checks the tracking information for a package on a page with a list of packages:</p> <pre><code>$(".fedex_status").each(function() { var item = this; // some code to construct tracking_url $.ajax({ type: "GET", url: tracking_url, async: true, cache: false, success: function(data) { $(item).html("(" + data + ")"); }, error: function() { $(item).html("request failed...");} }); }); </code></pre> <p>So if there are 10 packages on the page (10 things with class 'fedex_status') 10 requests are created. The requests work fine, but results are returned one at a time (in a serial manner). I added a timestamp to the start and stop of a request within the controller action:</p> <pre><code> public ActionResult Fedex(string trackingNumber) { DateTime requestStart = DateTime.Now; TrackingService tracking = new TrackingService(); string status = tracking.FedexTrackingNumberStatus(trackingNumber); return Content(status + " - " + requestStart.ToString("hh:mm:ss.FFF") + " - " + DateTime.Now.ToString("hh:mm:ss.FFF")); } </code></pre> <p>None of the timestamps overlap. So the controller is processing the requests one at a time. This seems crappy.</p> <p>Now, the ajax request 'should' be parallel. It definitely returns immediately (its asynchronous). When I look at the IIS logs the requests have the same timestamp as the controller action return.</p> <p>So my question is: is jquery not sending all the ajax requests in parallel or is IIS or ASP.NET only processing requests serially. I'm a big noob with IIS and the technical details of ASP.NET, so maybe its been misconfigured forever and only responds to one request at a time on everything (its internal use only, low traffic). That said, I'm also an idiot at jquery and not sure how to test when the requests are actually being fired (all I know is the $.ajax call returns immediately).</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload