Application_Start与serviceAutoStartProviders [英] Application_Start vs serviceAutoStartProviders
问题描述
我正在使用IIS7.5强制我的网络应用程序自动加载( startMode =AlwaysRunning
),我现在想要预加载我的缓存数据。我有点困惑,因为两种方法看起来完全相同:
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:
- 使用
Application_Start
in global.asax - 在IIS配置文件中使用
serviceAutoStartProviders
- use
Application_Start
in global.asax - use
serviceAutoStartProviders
in IIS config files
他们似乎相当多余并做同样的事情。如果是,我想我宁愿使用 Application_Start
而不是在IIS配置文件中创建代码依赖项。任何建议?
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?
推荐答案
global.asax中的 Application_Start
被触发当应用程序收到它的第一个请求(第一个用户或自动启动),因此它不用于启动站点。
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.
使用 serviceAutoStartProviders
开始
http://www.asp.net/whitepapers/aspnet4 #0.2__Toc253429241
IIS应用程序预热模块更易于使用
http://www.iis.net/learn/get-started/whats- new-in-iis-8 / iis-80-application-initialization
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
这篇关于Application_Start与serviceAutoStartProviders的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!