title: Why would multiple simultaneous AJAX calls to the same ASP.NET MVC action cause the browser to block?
body: <p>A few days back I asked this question:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/4359906/why-does-getjson-block-the-browser">Why does $.getJSON() block the browser?</a></p>
  </blockquote>
  
  <p>I fire six jQuery async ajax requests at the same controller action pretty much all at once. Each request takes 10 seconds to return.</p>
  
  <p>Through debugging and logging requests to the action method I notice that the requests are serialised and never run in parallel. i.e. I see a timeline in my log4net logs like this:</p>
  
  <pre>
  2010-12-13 13:25:06,633 [11164] INFO   - Got:1156
  2010-12-13 13:25:16,634 [11164] INFO   - Returning:1156
  2010-12-13 13:25:16,770 [7124] INFO   - Got:1426
  2010-12-13 13:25:26,772 [7124] INFO   - Returning:1426
  2010-12-13 13:25:26,925 [11164] INFO   - Got:1912
  2010-12-13 13:25:36,926 [11164] INFO   - Returning:1912
  2010-12-13 13:25:37,096 [9812] INFO   - Got:1913
  2010-12-13 13:25:47,098 [9812] INFO   - Returning:1913
  2010-12-13 13:25:47,283 [7124] INFO   - Got:2002
  2010-12-13 13:25:57,285 [7124] INFO   - Returning:2002
  2010-12-13 13:25:57,424 [11164] INFO   - Got:1308
  2010-12-13 13:26:07,425 [11164] INFO   - Returning:1308
  </pre>
  
  <p>Looking at the network timeline in FireFox I see this:</p>
  
  <p><img src="https://i.stack.imgur.com/A5UEL.jpg" alt="alt text"></p>
  
  <p>Both the log sample above and the Firefox network timeline are for the same set of requests.</p>
  
  <p><em>Are requests to the same action from the same page serialised?</em> I'm aware of serialised access to the <code>Session</code> object in the same session, but no session data is being touched.</p>
  
  <p>I stripped the client side code down to a single request (the longest running one) but this still blocks the browser, i.e. only when the ajax request completes does the browser respond to any link clicking.</p>
  
  <p>What I also observe here (in Chrome's developer tools) is that upon clicking on a link when a long running ajax request is executing it reports a <code>Failed to load resource</code> error  immediately which suggests that the browser has killed (or is attempting to kill and waiting?) the ajax request:</p>
  
  <p><img src="https://i.stack.imgur.com/jeE2B.jpg" alt="alt text"></p>
  
  <p>However the browser still takes an age to redirect to the new page.</p>
  
  <p>Are ajax requests really asynchronous or is this sleight of hand because javascript is actually single threaded?</p>
  
  <p>Are my requests just taking too long for this to work?</p>
  
  <p>The problem occurs in Firefox and IE as well.</p>
  
  <p>I also changed the script to use <code>$.ajax</code> directly and explicitly set <code>async: true</code>.</p>
  
  <p>I'm running this on IIS7.5, both the Windows 2008R2 and Windows 7 flavours do the same thing.</p>
  
  <p>Debug and release builds also behave the same.</p>