Will app_offline.htm stop current requests or just new requests?

前端 未结 2 489
时光说笑
时光说笑 2020-12-09 03:02

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?

2条回答
  •  既然无缘
    2020-12-09 03:45

    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
    "); System.Threading.Thread.Sleep(10000); Response.Write("Step 2
    "); System.Threading.Thread.Sleep(10000); Response.Write("Step 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.

提交回复
热议问题