Slow first Time in ASP.NET applications

19. March 2013 12:19 by Mrojas in   //  Tags: , , , , , ,   //   Comments (0)

Well, this is a recurrent topic with ASP.NET:Why is the first page load always so slowjQuery152032498610322363675_1363786231988?

I don't think there is a definite answer but I can think on some explanations:

  • ASP.NET applications by nature exhibit some degree of delay upon initial access to the site. This can be due to JIT compilation, caching, etc. 
  • Note that it is also a common effect on some sharepoint sites. 
  • Some people on StackExchange attribute this slowness to: " The IIS application pool is shut down after 30 minutes of inactivity. After that, when you make a request IIS basically has to start the website up again, which leads to the behavior you are describing. You can change the idle time of your website in iis though to avoid it." 
Workarounds
 
 
There are some workarounds for this situation:
 
For some years there has been a warmup script that you can use on pre-vs2010 apps:
 

ASP.NET Site Warm up on GitHub

 
And there is  even an IIS addin for that, the following blog provides some references about this addin:
 

ASP .NET Pre heating and the App Warmup Addin for IIS

 
These problem is so common that now in VS 2010 there is even an auto-start feature that you can use:

Auto Start Feature in ASP.NET 4

 
 I hope this links help and I'll add more explanations as I find them. Please feel free to comment.

Categories