1
votes

Does anybody known any objections from using ASP.NET method Application_Start for application warm-up?

Especially, for web-services, where is usually required to preload files, caches algorithms and etc.

Exist:

But, both methods require changes in IIS configuration for each application, what is uncomfortable in case with many-many applications and has additional risks on releases.

In accordance with ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0:

ASP.NET calls them (Application_Start and Application_End) once for the lifetime of the application domain, not for each HttpApplication instance.

Therefore, Application_Start seems like a great place for warm-up code, for example:

protected void Application_Start(object sender, EventArgs e)
{
    Task.Run(WarmUpBackend);
}

It requires only configure IIS App as AlwaysRunning. In WarmUpBackend we can preload everything what we need for web-services.

1

1 Answers

0
votes

You might be better off using a Service autostart provider.

Scott Guthrie has a blog post about this.