Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 702
Miki Watts Avatar asked Oct 07 '08 17:10

Miki Watts


People also ask

What does App_offline HTM do?

The App Offline file ( app_offline. htm ) is used by the ASP.NET Core Module to shut down an app. If a file with the name app_offline. htm is detected in the root directory of an app, the ASP.NET Core Module attempts to gracefully shut down the app and stop processing incoming requests.

Where to place App_ offline htm?

Typically, in IIS and ASP.NET, you accomplish this by placing a file named App_offline. htm in the root folder of the IIS website or web application.


1 Answers

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.

like image 77
Gabe Sumner Avatar answered Oct 11 '22 03:10

Gabe Sumner