How to make an asp.net mvc application to stay compiled
I have precompiled my application but开发者_StackOverflow中文版 every 10 - 30 min it unloads then when the page is hit it takes a long time to load. How do I make the application stay compiled forever?
It's not like the application is getting un-compiled, just that the worker process (and the app domain) is being unloaded from memory.
In your app pool settings in IIS, set the idle timeout for whatever time you need, or set it to never recycle due to idleness.
In addition to Josh's recommendation, check memory usage in case you're running up against the worker process memory limit and not a time-out.
Related question: Worker process recycles because it reached its virtual memory limit
If you're using .NET 4 and IIS 7.5, you can also use the new "Auto-Start" feature to avoid the initial load times.
http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx
精彩评论