How can you speed up the restart of an ASP.NET application?

application-pool, application-restart, asp.net, performance

Solution

There will be an "auto-start" feature in ASP.NET 4.0 (Scott Guthrie talks about it), but that won't help you now.

Please be sure that the Application Pool your website/application is running in, won't go to "sleep" automatically. A default AppPool is set to shut down after 20 minutes inactivty. As i recall this doesn't make the website rebuild, but makes the first request notably slower.

Small note, a website project can also be build, so your App_Code will be empty and your bin folder will contain a bunch of .dll's (just use Build > Build Website). This definitely will makes the first request to your site faster. I don't think a website application will kick in faster than a precompiled website project, but it is just easier to manage.

Problem

What can I do to ensure that when an application/app pool restart is triggered, that the application comes back online as fast as possible? Better yet, is there a way to prevent the application restart when the usual triggers occur? Like modifying the web.config, global.asax, or machine.config?

Original source