I have an MVC3 application that takes 30+ seconds for global.asax Application_Start() to execute. When a user hits the site for the first time after the App Pool was reset, the browser just sits there with a “waiting for website…” message.
Is there a way to show a “Loading data…” message/page to let the user know that everything is OK and to be patient?
No, there’s no way to show any messages from
Application_Start. IIS 7.5 has a cool AutoStart feature which allows you to preload your application in memory and thus avoid the long waiting. Another possibility is to have some external service that queries your site at regular intervals so that it doesn’t get unloaded by IIS.If you cannot use this feature, then you will have to reduce/optimize the amount of work you do in your
Application_Startso that it doesn’t take 30 seconds.