空闲超时后 Web 服务响应时间

发布于 2024-10-04 11:24:56 字数 186 浏览 0 评论 0原文

我有一个返回 pdf 内容的网络服务。

我注意到,当我离开网站一段时间并调用该服务的方法时,需要很长时间才能响应。任何后续调用都只需不到一秒,这非常棒。

有人能告诉我这是为什么吗?服务是否已进入睡眠状态并需要重新初始化?

解决这个问题有什么好办法吗?每次访问该页面时我可以做些什么来告诉服务请求很快就会通过吗?

I have a webservice which returns the content of a pdf.

I've noticed that when I've left the website for a while and I call the method of the service it takes a long time to respond. Any subsequent calls take less than a second which is great.

Can someone tell me why this is? Has the service gone to sleep and needs to reinitialise?

What would be a good way around this? Is there something I could do each time that page gets visited to tell the service a request could come through very soon?

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

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

发布评论

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

评论(1

千寻… 2024-10-11 11:24:56

我假设您在 IIS 中托管该服务。

与任何其他基于 Web 的应用程序一样,运行服务的 AppDomain 可能因多种原因而被回收。一个可能的原因是空闲超时。

如果你不想因为空闲而超时,可以适当更改IIS设置。

I'm assuming you're hosting the service in IIS.

Like any other web-based application, the AppDomain in which the service runs can be recycled for several reasons. One possible reason is an idle timeout.

If you don't want it to time out due to idleness, you can change the IIS settings appropriately.

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