浏览器超时

Spl*_*lin 62 javascript browser ajax

浏览器是否内置了超时,如果是,那么它们是什么?

我有一个页面在一个进程上执行AJAX调用,最多运行5分钟.有人说浏览器在2分钟后超时,但不知道是否有任何道理.

hak*_*ick 39

它取决于浏览器."默认情况下,Internet Explorer的KeepAliveTimeout值为1分钟,另外一个限制因子(ServerInfoTimeout)为2分钟.这两种设置都可能导致Internet Explorer重置套接字." - 从IE支持http://support.microsoft.com/kb/813827

Firefox与我的想法大致相同.

通常虽然服务器超时设置低于浏览器超时,但至少可以控制它并将其设置得更高.

你宁愿处理超时,这样你就可以对这样的事件采取行动.请参阅此主题:如何在浏览器中检测AJAX(XmlHttpRequest)调用的超时?

  • 显然Firefox大约需要300秒.http://morgb.blogspot.de/2014/05/firefox-29-and-http-response-timeout.html (2认同)
  • FF 中的[默认配置](https://imgur.com/bvnGnpp.png) 为 300 秒 (2认同)

Kal*_*ico 11

您可以在此链接中看到Chrome中的默认值

int64_t g_used_idle_socket_timeout_s = 300 // 5 minutes
Run Code Online (Sandbox Code Playgroud)

在Chrome中,据我所知,没有一种简单的方法(如Firefox那样)来更改超时值.

  • 对于Firefox,我使用[这个答案](https://superuser.com/a/303250)来更改超时。 (2认同)
  • 我稍微误读了你的答案,但我会留下评论,它可能会对某人有所帮助。 (2认同)