How can I keep an IE page request alive more than

2019-06-03 08:48发布

If you are connected to the Internet directly (and not through a proxy) and requests for a page (get/post) in Internet Explorer 7, the default time-out is 1 minute. If the response from the web server takes more than a minute then you end up getting a "Network error" from IE.

How can I increase this timeout in IE?

Microsoft has documented How to change the default keep-alive time-out value in Internet Explorer, but this does not work in my PC (Windows XP SP2, IE 7.0).

Does anyone out there have a clue on how to achieve this?

Thanks

2条回答
Viruses.
2楼-- · 2019-06-03 09:24

From the same article,

If either the client browser (Internet Explorer) or the Web server has a lower KeepAlive value, it is the limiting factor. For example, if the client has a two-minute timeout, and the Web server has a one-minute timeout, the maximum timeout is one minute. Either the client or the server can be the limiting factor.

This may be the reason the settings are not working for you.

查看更多
Animai°情兽
3楼-- · 2019-06-03 09:30

KB813827 is talking about HTTP 1.1 keepalives, which are to do with keeping a TCP connection to the server open outside of a request. That's not the same thing as your problem, which is keeping a connection alive during a request. To configure the per-connection timeout see KB181050.

Assuming the programming angle here is that you are trying to write a server-side script that takes a long time to complete:

To avoid the request timing out, you need to have the server-side script return something every so often to reassure the browser that the server hasn't died and a result will be forthcoming.

How exactly you might do this depends on what server-side technologies you're using. Anything that waits for the entire response body and headers to be completed before sending anything back to the client is out. In eg. CGI you could return a response body with 'Transfer-Encoding: chunked' to spit out a few bytes every so often and keep the connection alive.

Alternatively, return a page right away and spawn the long process in the background, then have the client side page poll for its completion.

查看更多
登录 后发表回答