static field in ASP.NET MVC

前端 未结 1 417
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 10:37

I have static field with large object in ASP.NET MVC controller. For the first request i initialize this field and it is available for the next queries. But after waiting 10

相关标签:
1条回答
  • 2020-12-22 10:52

    Your application pool is probably recycling.

    You should be populating any globals like this in application_start, that way they will be reloaded on subsequent requests, even if the pool recycles.

    By default if there is no activity for a few minutes it will be unloaded, causing the application to have to be reloaded from scratch. You can prevent or reduce the occurances of the application pool recycling by configuring the application pool settings in IIS Administration.

    0 讨论(0)
提交回复
热议问题