Run Application_Start immediately when application pool restarts in IIS

后端 未结 2 1754
栀梦
栀梦 2020-12-16 17:32

We are doing some caching operations in the application_start phase in the application. So all the cache is going away when the application pool restarts. Is it possible to

2条回答
  •  被撕碎了的回忆
    2020-12-16 18:13

    Application_Start is called only at the first request. I'm not sure it's a good idea to cache something if no requests are made.

    I would you simply load the cache upon the first request.
    Your CacheManager could decide if it's need to load it's data automatically.

    Are you afraid the first request will be slower ?.

提交回复
热议问题