98

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 timeout after 2 minutes but didn't know if there was any truth to that.

Kalamarico
  • 5,466
  • 22
  • 53
  • 70
Splashlin
  • 7,225
  • 12
  • 46
  • 50
  • 1
    I've had pages processing for upwards of 15 minutes before without a timeout, with a successful return (long php script). – Mikecito Apr 27 '11 at 02:36
  • @Mikecito - We're you always using the same browser or did you use multiple ones on it? – Splashlin Apr 27 '11 at 02:40
  • Um... I know at least on IE 8 and chrome on Windows, Chrome and Safari on Mac, but not sure which one has the longest timeout. It varied for me between 5 and 15 minutes per script, and I can't remember which was on which. – Mikecito Apr 27 '11 at 02:53
  • 1
    related http://stackoverflow.com/questions/1342310/where-can-i-find-the-default-timeout-settings-for-all-browsers – Adriano Jul 02 '14 at 08:01
  • @Mikecito did your user have to change their browser settings to make this work ? – Adriano Jul 02 '14 at 08:03
  • 3
    For requests with a long response time, an immediate 202 Accepted might be more appropriate: "the request has been accepted for processing, but the processing has not been completed. [...] Its purpose is to allow a server to accept a request [...] without requiring that the user agent's connection to the server persist until the process is completed. The [...] response ought to describe the request's current status and point to (or embed) a status monitor that can provide the user with an estimate of when the request will be fulfilled." Source: https://tools.ietf.org/html/rfc7231#section-6.3.3 – kuporific Aug 18 '15 at 15:09

2 Answers2

44

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?

Community
  • 1
  • 1
haknick
  • 1,892
  • 1
  • 20
  • 28
  • 5
    Apparently Firefox is around 300 seconds. http://morgb.blogspot.de/2014/05/firefox-29-and-http-response-timeout.html – Marcus Jul 02 '14 at 16:08
  • 2
    the [default config](https://imgur.com/bvnGnpp.png) in FF is 300 seconds – asgs Dec 08 '18 at 20:43
21

You can see the default value in Chrome in this link

// 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.

Ignitor
  • 2,907
  • 33
  • 50
Kalamarico
  • 5,466
  • 22
  • 53
  • 70
  • 2
    for Firefox, I used [this answer](https://superuser.com/a/303250) to change the timeout. – g2server Mar 28 '18 at 08:14
  • Yeah, that's was I meant with the "easy way as firefox do", in Chromium source code it's easy to change and compile as I said, but didn't know an "easy way" on the flight – Kalamarico Mar 29 '18 at 11:40
  • 2
    I misread your answer slightly but I'll leave the comment, it may help someone. – g2server Mar 29 '18 at 11:44