app_offline.htm会停止当前请求还是仅停止新请求? [英] Will app_offline.htm stop current requests or just new requests?

查看:163
本文介绍了app_offline.htm会停止当前请求还是仅停止新请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像标题所说,如果我在应用程序根目录中放置 app_offline.htm ,它会切断当前正在运行的请求,还是只删除新请求?

Like the title says, If I place an app_offline.htm in the application root, will it cut off currently running requests, or just new ones?

推荐答案

这是我的蹩脚实验;我使用以下代码创建了一个ASPX页面:

Here is my lame experiment; I created an ASPX page with the following code:

protected void Page_Load(object sender, EventArgs e)
{
    Response.BufferOutput = false;
    Response.Write("Step 1<br />");
    System.Threading.Thread.Sleep(10000);
    Response.Write("Step 2<br />");
    System.Threading.Thread.Sleep(10000);
    Response.Write("Step 3<br />");
}

此代码简单介绍了一些loooong页面加载。我访问了页面,在加载时,我创建了一个app_offline.htm文件。然后我加载了另一个Web浏览器并确认应用程序处于脱机状态然后我重新访问了我的加载请求......它一直完成到第3步。

This code simply introduces some loooong page loads. I accessed the page and while it was loading, I created an "app_offline.htm" file. I then loaded another web browser and confirmed the application was offline. I then re-visited my "loading" request...it completed all the way to step 3.

这确认当前请求已完成加载并且新请求被拒绝。

This confirms that current requests finish loading and new requests are turned away.

这篇关于app_offline.htm会停止当前请求还是仅停止新请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆