Kam had written an interesting blog post on how to Precompiled view support has been added to Sitecore 8.2 (http://kamsar.net/index.php/2016/09/Precompiled-Views-with-Sitecore-8-2/) I wanted to implement this on 8.1 U3.
We don't have the automatic scaffolding but it turns out that setting this up is very straight forward, install the RazorGenerator.MsBuild task and then using RazorGenerator.Mvc to register the assembly.
We quickly had a working solution that showed really great improvements in the Sitecore first boot time and the time it took to load any page for the first time. We also get the added advantage of compile time checks!
So great everything works fine but the Sitecore backend UI, e.g. Launch Pad and other SPEAK views, was still slow. So we thought why not try compiling these into an assembly?
To do this we performed the following steps:
With these views compiled I can rebuild my solution and get back into LaunchPad in less than 30 seconds. The whole experience also feels more responsive making working with Sitecore even better.
Since you only need to compile these views once it is best not to include this project in your main project because it will make the compile a little slower. A better solution would be to put the DLL into a Nuget package and add this to your project.
Glass.Mappper.Sc is supported by the generous donations of the Glass.Mapper.Sc community! Their donations help fund the time, effort and hosting for the project.
These supporters are AMAZING and a huge thank you to all of you. You can find our list of supporters on the Rockstars page.
If you use Glass.Mapper.Sc and find it useful please consider supporting the project. Not only will you help the project but you could also get a discount on the Glass.Mapper.Sc training and join the Rockstars page.