Slow initial page load in development

Vote:
 

Hey guys,

I've worked on a few episerver CMS projects and one thing about developing on them is that it's really time consuming waiting for the initial page to load after a rebuild.

The build itself only takes a few seconds, but when trying to load a page on the epi site, it takes minimum of 3 - 5 minutes before it actually appears.

Although, once the initial page loads, everything else on the site is quick and behaves as I expect it to.

I've asked around, and other epi devs just say it's something they put up with, but my question to you guys, is this really the case? Do you really have to wait a few minutes between each build to test out your changes?

What are some settings I could look at to improve the initial page load speed? Are there any tools you guys would recommend to diagnose where the bottleneck may be?

#201505
Feb 21, 2019 8:22
Vote:
 

That is quite slow. Any more than 2 minutes and I would be annoyed.

Does first load feature many blocks, images or content links?

The first load is always slow, because Episerver is loading itself, as well as add-ons and custom initialization modules.
Because the content cache is empty, Episerver loads the requested page from the database, including all content items used on that page (one item at a time). On second load, content is served from the content cache.

I usually use dotTrace and SQL Server Profiler to profile a slow site. dotTrace will show which code paths are slow and why. SQL Server Profiler will show if the database queries are the bottleneck.

#201510
Feb 21, 2019 9:37
Vote:
 

This https://github.com/episerver/DeveloperTools would be very useful to find out which initialization modules are slow

of course if you want to break down to bare metal level, then suggestion by Stefan (dotTrace + SQL Server Profiler) is still the gold standard

#201512
Feb 21, 2019 9:52
Vote:
 

Have you got application insights installed I had to disable it in debug mode as was really slow for me as well

I now have this in my startup.cs 

#if DEBUG
            TelemetryConfiguration.Active.DisableTelemetry = true;
#endif

#201514
Feb 21, 2019 11:41
Vote:
 

3-5 minutes is a lot.

Some of the things that can affect startup times:

  • initialization modules and other custom code that is running on application startup (global.asax.cs, Startup.cs, etc.)
  • database (shared plans in Azure, etc.)
  • custom view engines (Episerver doesn't allow you to precompile razor views. If you have a page that contains a lot of blocks and block views are located all over the solution, startup times will be quite slow)  

  

Do you run the code in IIS Express or IIS?

Good luck!

#201519
Edited, Feb 21, 2019 15:30