When i send two ajax requests together using JQuery .. the response come together
for example
$.ajax
({
type: "POST",
url: 'ajax.php'
});
$.ajax
({
type: "POST",
url: 'ajax2.php'
});
ajax.php , ajax2.php are two files contain a dummy for loop take about 5 sec.
FireBug Screen
POST localhost/ajax.php 200 OK 4.77s
POST localhost/ajax.php 200 OK 4.37s
Here every request take about 5 sec to be executed .....
When i do the same example at symfony i got different result
$.ajax
({
type: "POST",
url: 'module/action1'
});
$.ajax
({
type: "POST",
url: 'module/action2'
});
action1 , action2 are two action just contain a dummy for loop take about 5 sec.
FireBug Screen
POST localhost/web/frontend_dev.php/module/action1 200 OK 4.47s
POST localhost/web/frontend_dev.php/module/action2 200 OK 9.87s
Notice that the second request executed after the first one finished , i don't know why that happened
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…