tags:

views:

470

answers:

2

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?

+1  A: 

From ScottGu's blog:

Basically, if you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application. ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).

http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx

So, it seems like it will continue processing current request, but stop new incoming requests.

Brian Kim
+5  A: 

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 />");
}

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.

Gabe