I have an ASP.NET MVC3 project where an aspx main page dynamically loads its parts using jQuery ajax. Thus, basically, when a site loads, it gets into / Home / Index, and then in the Index view (aspx) there are several jQuery lines that make ajax calls (in / Home / PartOne and / Home / PartTwo to fill in the parts pages.
Thus, every time a page loads, it basically makes 3 requests: get the index, get PartOne, and then PartTwo.
Question: why is there some kind of βwaitβ for the third request? I thought this was a limitation on the simultaneous request of the browser, but why is it not executed after the first request is made?
When I experimentally put the "OutputCache" attribute in "PartTwo", it behaves as expected to be fast. This indicates that the problem is not in IIS, but somewhere after that and before it hits my action method.
Here is a screenshot from the Chrome Network Profiler: 
Here is a screenshot on MvcMiniProfiler - look at the third line / value, it waits 500 ms before executing the controller action code. 
My controller code looks like this. Although I cut off the actual code, but the code for PartTwo is very trivial (no long calculations, no db calls, etc.):
public class HomeController : Controller { public ActionResult Index() { // do something here return View(); } public ActionResult PartOne() { // do something here return View(); } public ActionResult PartTwo() { // do something here return View(); } }
My javascript:
$(document).ready(function () { $.ajax({ url: "/Home/PartOne", cache: false, success: function (data, textStatus, request) { $("#TestContainerOne").html(data); } }); $.ajax({ url: "/Home/PartTwo", cache: false, success: function (data, textStatus, request) { $("#TestContainerTwo").html(data); } }); });
My index.aspx:
<h2>Home page</h2> <div id="TestContainerOne"></div> <div id="TestContainerTwo"></div>
PartOne.ascx:
<h2>Part One</h2>
PartTwo.ascx:
<h2>Part Two</h2>
reference