Application_Start vs serviceAutoStartProviders

I use IIS7.5 to make my web application load automatically ( startMode="AlwaysRunning" ), and now I want to preload the cache data. I'm a little confused, although the two approaches seem the same:

  • use Application_Start in global.asax
  • use serviceAutoStartProviders in IIS configuration files

They seem redundant and do the same. If so, I'd rather use Application_Start than create code dependencies in IIS configuration files. Any tips?

+5
source share
1 answer

Application_Start in global.asax is launched when the application receives its first request (first user or autostart), so it is not used to start the site.

Use serviceAutoStartProviders to launch 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

+3
source

Source: https://habr.com/ru/post/1213525/


All Articles