gpt4 book ai didi

asp.net - asp.net 应用程序继续运行时浏览器超时

转载 作者:行者123 更新时间:2023-12-04 16:57:10 24 4
gpt4 key购买 nike

我遇到的情况是 ASP.NET 需要很长时间才能通过网页生成回复(超过 2 小时)。这是由于代码隐藏运行了一段时间(很长,很慢的循环)。

浏览器(IE 和 Firefox)停止等待回复(大约一个小时后)并给出通用的无法显示网页错误(类似于您尝试导航到不存在的服务器时看到的内容)。

同时 asp.net 应用程序继续运行(我可以在调试器中看到它)并最终完成。

为什么会这样? web.config 中是否有任何设置可以影响这一点?我希望有一个我错过的超时设置导致了这种情况。

也许是 IE 或 Firefox 中的设置?但我认为他们在服务器保持连接时等待。

即使我从 VS 在本地计算机上以 Debug模式(编译 debug="true")启动应用程序(因此它不是在 IIS 上运行,而是在 ASP.NET 开发服务器上运行),我也会遇到这种情况。

我知道生成页面需要这么长时间是不好的,但在这个阶段并不重要。加快速度将需要大量额外的工作,而延迟并不重要。这是内部使用的。

我意识到我可以围绕这个问题重新设计将逻辑运行到后台进程并在通过 AJAX 完成时收到通知,或者将其拉到桌面应用程序或服务或其他任何东西。最终会按照这些思路做一些事情,但这不是我现在要问的。

最佳答案

听起来您正在使用 IE,并且在等待服务器响应时超时。

您可以找到一篇 technet 文章来调整此限制:

http://support.microsoft.com/kb/181050

CAUSE

By design, Internet Explorer imposes a time-out limit for the server to return data. The time-out limit is five minutes for versions 4.0 and 4.01 and is 60 minutes for versions 5.x, 6, and 7. As a result, Internet Explorer does not wait endlessly for the server to come back with data when the server has a problem. Back to the top

RESOLUTION

In general, if a page does not return within a few minutes, many users perceive that a problem has occurred and stop the process. Therefore, design your server processes to return data within 5 minutes so that users do not have to wait for an extensive period of time.

关于asp.net - asp.net 应用程序继续运行时浏览器超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/633075/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com