I’m currently dealing with very annoying performance problems after deploying an ASP.NET MVC4 application to Microsoft Azure. Right after restarting the app (or after a few minutes of inactivity) some pages take about 15 seconds to load for the first time. After this, even when clearing the clientside cache those pages will load in about 2 seconds (which is still in need of improvement but way better than 15 seconds, which is a huge user experience killer).
Here’s what I’ve already tried so far:
- I combed through every event in Global.asax in order to replace database-related code with dummy-code
- Changing the publish settings to: «Precompile during publishing» (Merge all outputs to a single assembly)
- According to Azure’s «App Performance Analysis» my app is considered «healthy»
- «Always On» is activated within the portal's app settings (The pricing tier is B1 [Basic, 1 Core, 1.75GB RAM], therefore I assume that the always-on-switch doesn't get overridden by the shared runtime configuration)
Since none of the bullets above solved my issue I tried out to write a keppalive-Job using Quartz.NET that regularly requests the website like this:
new System.Net.WebClient().OpenRead("https://foo.azurewebsites.net");
(In my case, I think the effect is more or less the same as declaring initializationPages within Web.Config as mentioned here, isn’t it?)
The result: It works, but just for this specific URL. Maintaining a list of every possible route definitely isn't the way to go.
Have you ever dealt with this issue? I’d highly appreciate your inputs!