Browser Timeouts
Do browsers have built in timeouts and if so what are they?
I have a page that does an AJAX call on a process that takes at most 5 minutes to run. Someone said browsers time开发者_JAVA技巧out after 2 minutes but didn't know if there was any truth to that.
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
精彩评论