Precompile razor view before publishing
Compiling views on the webserver takes a lot of ressource, and during that time the application is slow to respond.
I would be great if we could publish compiled versions of our views. I know razorgenerator do this, but it's not native and we only want compile views for deployment, not when developing.
There is a preview of this in ASP.NET MVC 6
David Ebbo has this excellent post showing how you can.http://blog.davidebbo.com/2011/06/precompile-your-mvc-views-using.html hTere is an open source project that you can use.
Nick Craver commented
The problem I see here is if you can change the factoryType, that type/provider can depend on...well, anything. For example at Stack Exchange we change the factory to do localization at view compile time, this wouldn't run the same locally so publishing remotely doesn't work.
While I agree it's a good feature in general (we spend WAY too much time compiling views currently, which needs other fixes), it may have to include instructions on when this optimization could be used.
Eric Sieg commented
Getting precompiling views into the core of MVC would be great in a variety of ways. Potential errors now (toggle this off/on) rather than at runtime as well as during deployment to improve performance. Razor generator is a great stopgap measure, but can have problems. Seeing this become a more core part of the MVC experience would be great.