镀铬处理的智能网址,并导致并发请求挂起对方 [英] Chrome treating smart url and causing concurrent requests pend for each other

查看:102
本文介绍了镀铬处理的智能网址,并导致并发请求挂起对方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了在谷歌铬一个奇怪的问题,当一个标签是一个长时间运行脚本开放的,不同的标签是待定状态,直到第一个选项卡完成。我已经创建一个小的小提琴重现这个问题,我还包括从这里在Safari上运行结果。当此琴是增加了一个Q = a和Q = B检查解决此问题。然而,当我打电话给两个不同的智能网址( http://domain.com/a/v1 http://domain.com/ A / V2 甚至 http://dev.domain.com/a/v6 的http://开发.domain.com / b / V8 ),他们也是造成这种待处理的行为。

I'm experiencing a weird issue in Google-Chrome that when one tab is open with a long-running script, a different tab is in 'pending' state until the first tab finishes. I've create a small fiddle to reproduce this issue and am also including here results from the run on Safari. When this fiddle is added a ?q=a and ?q=b it resolves this issue. However, when I'm calling two different smart urls ( http://domain.com/a/v1 http://domain.com/a/v2 or even http://dev.domain.com/a/v6 or http://dev.domain.com/b/v8) they are also causing this 'pending' behavior.

小提琴:

<?php
echo time();
echo '<br>Now:       '. date('h:m:s');

sleep(10);

echo time();
echo '<br>Now:       '. date('h:m:s');

?>

在谷歌浏览器打开它两个并行的选项卡,输出:
1:

When opening two concurrent tabs with it in Google Chrome, output: 1:

Now: 11:01:12
1357117332
Now: 11:01:22
1357117342

2

Now: 11:01:22
1357117342
Now: 11:01:32
1357117352

正如你所看到的,虽然我几乎在同一时间开始了他们两个,第二个等待第一个完成它开始之前。

As you can see, although I started them both almost at the same time, the second one waiting for the first to finish before it began.

同样的事情:
1:

Same thing when running on Safari: 1:

Now: 10:01:36
1357116336
Now: 10:01:46
1357116346

2

Now: 10:01:37
1357116337
Now: 10:01:47
1357116347

正如你可以看到,在Chrome第二个脚本仅启动后的第一个成品,而在Safari浏览器,他们一起工作。
哪些原因会导致这种怪异的行为?
我应该寻找什么样的信息,以帮助调试原因是什么?

As you can notice, in Chrome the second script started only after the first finished, while in Safari, they worked together. What can cause this weird behavior? What information should I look for to help debug the cause?

更新:??,加入Q =一和q = B解析这是正确的答案。现在,我想弄清楚,为什么摆在首位,我在这个问题上运行,虽然我打电话给两个不同的URL。我使用的是智能的网址,网址,看看 domain.com/dir/var1 domain.com/dir/var2 甚至 dev.domain.com/var6 都会导致同样的效果。这是什么原因?

UPDATE: The answer that adding ?q=a and ?q=b resolves this is correct. Now I'm trying to figure out why in the first place I'm running in this issue although I'm calling two different urls. I'm using smart url, urls look domain.com/dir/var1 and domain.com/dir/var2 and even dev.domain.com/var6 all cause the same effect. What can cause this?

推荐答案

这是一个Chrome的行为。

It's a Chrome behaviour.

如果您执行GET请求完全相同的网址 - 它会等待,直到第一个结束。仅仅通过一些附加的不同的的如?Q = A 参数更改网址,看看他们会同时执行。

If you perform a GET request to exactly the same url - it will wait until the first ends. Just change urls by appending some different parameters like ?q=a and see they will execute simultaneously.

这篇关于镀铬处理的智能网址,并导致并发请求挂起对方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆