Multiple ajax calls not working asynchronously (slow TTFB)

I have some simple ajax calls to populate dropdowns:

window.addEventListener('load', function () { GetDropDownData('http://mysite/controller/action/parameters1', '#ddl1') });
..
window.addEventListener('load', function () { GetDropDownData('http://mysite/controller/action/parameters4', '#ddl4') });

$.ajax({
        url: url,
        cache: true,
        crossDomain : true,
        dataType: 'jsonp',
        type: "GET",
        success: function (data) {
            $(id).html(data);
        },
        error: function (reponse) {
            $(id).html("error : " + reponse.responseText);
        }
    });

      

if I use them individually, fast, but used together slowly. This can be seen in the images below. The first time I use 1 call and it is fast, the second time I use 2 calls and the previous one gets slow. It's the same with multiple calls. enter image description hereenter image description hereenter image description here

Why is this? And can I solve this problem by avoiding combining calls into one call?

+3


source to share


1 answer


Session hijacking? One call comes in, blocks the session, the second must wait for the first to complete.

Try disconnecting the session and see if it improves

(i had the same problem)



Note. This answer only applies if the calls are asynchronous (as per another comment)

http://johnculviner.com/asp-net-concurrent-ajax-requests-and-session-state-blocking/

+2


source







All Articles