I have an S1 Production App Service configured for:
* .NET V4.7
* 64bit
* Integrated pipeline
* "Always on" is enabled.
I'm building a standard ASP.NET MVC 4.7.2 web application, and currently deploying using the the Publish option in Visual Studio 2019 Community.
I'm finding after each deployment to Azure, time for the first load of most pages (not just the first page I hit) is slow.
Specifically, it "feels" like each Controller has a slow initial load time, almost like each Controller needs to individually compile the first time it is accessed.
For example:
- I browse to /Controller1/Action1 and it's a 5-10 second compile.
- I browse to /Controller1/Action2 and it's <1s.
- I browse back to /Controller1/Action1 and it's now <1s.
- Then I browser to /Controller2/Action1 and against it has the delayed 5-10 second wait. Refresh the page and is <1s.
And so on.
I don't mind the very first time the first page is accessed after a deployment being slow, but not every page/controller. Especially when I'm deploying and testing multiple times per day.
Any ideas what is happening with this behaviour and how to fix it?
Update (45 mins later)
I wrote this after doing a deployment and noticing the behaviour described above. At the time I went through and test about 12 routes (pages) on the site.
I just did another deployment to the site and re-tested those routes and all were must faster on first load after deployment.
However, there were some routes I missed the first time that I tested after this deploy and they exhibited the same "slow on first load load" behaviour.