如何使 IE 页面请求保持活动状态超过 1 分钟?

发布于 2024-07-13 07:54:49 字数 365 浏览 3 评论 0原文

如果您直接(而不是通过代理)连接到 Internet 并在 Internet Explorer 7 中请求页面(获取/发布),则默认超时为 1 分钟。 如果 Web 服务器的响应时间超过一分钟,那么您最终会从 IE 收到“网络错误”。

如何增加 IE 中的超时时间?

Microsoft 已记录如何更改 Internet Explorer 中的默认保持活动超时值,但是这在我的电脑(Windows XP SP2、IE 7.0)上不起作用。

有谁知道如何实现这一目标吗?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笨死的猪 2024-07-20 07:54:49

KB813827 讨论的是 HTTP 1.1 keepalive,它与在请求之外保持与服务器的 TCP 连接保持打开状态有关。 这与您的问题不同,您的问题是在请求期间保持连接处于活动状态。 要配置每个连接超时,请参阅 KB181050

假设这里的编程角度是您正在尝试编写一个需要很长时间才能完成的服务器端脚本:

为了避免请求超时,您需要让服务器端脚本返回一些东西时不时地向浏览器保证服务器还没有死机并且结果即将到来。

具体如何执行此操作取决于您使用的服务器端技术。 在将任何内容发送回客户端之前等待整个响应正文和标头完成的任何内容都将被淘汰。 例如。 CGI 您可以返回带有“传输编码:分块”的响应正文,以每隔一段时间吐出几个字节并保持连接处于活动状态。

或者,立即返回页面并在后台生成长进程,然后让客户端页面轮询其完成情况。

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.

俏︾媚 2024-07-20 07:54:49

来自同一篇文章,

如果客户端浏览器(Internet
Explorer) 或 Web 服务器有
较低的KeepAlive值,它是
限制因素。 例如,如果
客户端有两分钟的超时时间,并且
Web 服务器有一分钟的时间
超时,最大超时为1
分钟。 无论是客户还是
服务器可能是限制因素。

这可能是这些设置不适合您的原因。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文