当我使用 JQuery 一起发送两个 ajax 请求时.. 响应一起
$.ajax
({
type: "POST",
url: 'ajax.php'
});
$.ajax
({
type: "POST",
url: 'ajax2.php'
});
Run Code Online (Sandbox Code Playgroud)
ajax.php , ajax2.php 是两个文件,包含一个虚拟的 for 循环大约需要 5 秒。
POST localhost/ajax.php 200 OK 4.77s
POST localhost/ajax.php 200 OK 4.37s
这里每个请求大约需要 5 秒才能执行.....
当我在 symfony 做同样的例子时,我得到了不同的结果
$.ajax
({
type: "POST",
url: 'module/action1'
});
$.ajax
({
type: "POST",
url: 'module/action2'
});
Run Code Online (Sandbox Code Playgroud)
action1 , action2 是两个动作,只包含一个虚拟的 for 循环大约需要 5 秒。
POST localhost/web/frontend_dev.php/module/action1 200 OK 4.47s
POST localhost/web/frontend_dev.php/module/action2 200 OK 9.87s
请注意, …