Now this this could be a simple question, but I am a little confused.
I published my MVC3 C# .NET web application to a IIS folder. I have selected the precompile options and unchecked the "allow site to be updateable" to ensure Views are compiled, and they are, to ".compiled" files in bin ie:
_createoredit.cshtml.1c32bb75.compiled
The "cs" files are compiled into the main project dll ie.
myApp.dll
On first call, the page can take 30 - 60 secs to load then < 1 sec
If I refresh the app pool the page then takes 30-60 secs again.
My current understanding is that this time delay is caused by the jitter compiling the byte code in the dll into binary code ??
I had hoped to significantly increase response time post app pool refresh by precompiling the Views. However not so, but perhaps this is due to the fact the my project file is in byte code, and that I need to do something more to it?
I do understand that you can keep web apps warm by repinging the site, but the reality is that app pools do get refreshed for strange reasons. Also I am using Azure. So I would really like to use deployed units of code that will run as quickly as possible after a refresh.
Many thanks in advance for any help.
EDIT
Having precompiled the Views and deployed to Azure Websites using Shared or Standard instances, I still get the initial load lag, instigated by an AppPool refresh which I deliberately cause by a resave of the Web.config. To be honest I am not seeing any significant benefit in precompiling the Views, as I still get a time penalty when .NET seems to further compile the ".compiled" views on first load.
EDIT2
More information in reference to @Yishal's post.
I am using Basic on dev and standard on test. I have enabled "Always on" which is in effect an autoping. I also have "Uptime-robot" autopinging. I have also tested a seperate shared site with all Views precompiled. The autopinging helps to keep the app pool warm. However if the app pool refreshes ie via web.config resave (for testing) then one get the long initial wait again. Can be up to a minute, then < 1 sec for same page. The only thought I have is that it is taking ~ 60 secs for the project.dll(.net p-code) to be compiled down to binary and be held in RAM.