浏览器超时

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

我有一个页面,它对一个最多需要5分钟运行的进程执行 AJAX 调用。有人说浏览器会在2分钟后超时,但不知道这是否属实。

135391 次浏览

It's browser dependent. "By default, Internet Explorer has a KeepAliveTimeout value of one minute and an additional limiting factor (ServerInfoTimeout) of two minutes. Either setting can cause Internet Explorer to reset the socket." - from IE support http://support.microsoft.com/kb/813827

Firefox is around the same value I think as well.

Usually though server timeout are set lower than browser timeouts, but at least you can control that and set it higher.

You'd rather handle the timeout though, so that way you can act upon such an event. See this thread: How to detect timeout on an AJAX (XmlHttpRequest) call in the browser?

You can see the default value in Chrome in this [link][1]

// The maximum duration, in seconds, to keep used idle persistent sockets alive.
int64_t g_used_idle_socket_timeout_s = 300;  // 5 minutes

In Chrome, as far as I know, there isn't an easy way (as Firefox do) to change the timeout value. [1]: https://cs.chromium.org/chromium/src/net/socket/client_socket_pool.cc?sq=package:chromium&l=25