I suggest you ...

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.

Thanks

249 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    AnonymousAnonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Nick CraverNick Craver commented  ·   ·  Flag as inappropriate

        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 SiegEric Sieg commented  ·   ·  Flag as inappropriate

        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.

      Feedback and Knowledge Base