Why Sitecore is so slow at first request…

I’ve noticed that Helix projects – while offering a lot – do seem to be slow to respond to the first request. Painfully slow. Like “Application Initialization is required” slow. I knew that this was due to view compilation at runtime (something that could be handled by compiling your views at, you know, compile time) – but I’d always wondered why it was so slow.

Well, I think I’ve found the answer – Hundreds of renderings? Your first-page-load could be sloooow by Chris Perks.

The TL;DR is that compiling viewfiles works on batches per directory. If you have more directories … you have to have more batches. Which takes longer. And Helix encourages you to have more directories…

Solutions:

  • Compile your views at compile time. I tried this on my current project. It wasn’t pretty. I’ll need to lobby for time to do.
  • Put your viewfiles in 1 directory. (For Helix, you could prefix each filename with the module name, rather than relying on folders per module).

References:

Why Sitecore is so slow at first request…

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.