Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application_Start vs serviceAutoStartProviders

I am using IIS7.5 to force my web app to load automatically (startMode="AlwaysRunning"), and I now want to preload my cache data. I am a bit confused though because two approaches seem identical:

  1. use Application_Start in global.asax
  2. use serviceAutoStartProviders in IIS config files

They seem rather redundant and doing the same thing. If they are, I guess I would rather use Application_Start than create code dependencies in IIS configuration files. Any advice?

like image 679
mmix Avatar asked Feb 17 '15 10:02

mmix


1 Answers

The Application_Start in the global.asax is fired when the application receives it's first request (first user or autostart) so it is not used to start the site.

Use serviceAutoStartProviders to start http://www.asp.net/whitepapers/aspnet4#0.2__Toc253429241

The IIS Application Warm-Up Module is easier to use http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization

like image 158
Erik Oppedijk Avatar answered Sep 29 '22 15:09

Erik Oppedijk