You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
As mentioned in the thread #2866 compiling Razor views takes time. With the latest package from Nuget I found that launching the compiler for the first view takes 3-4 seconds and each additional view needs around 50 ms to compile.
This is an issue for a Nancy server in an application that users launch and expect to work with as quickly as possible. I understand that with the current Nancy architecture Razor views need to be compiled after each start of an application.
To ensure that a desktop application starts as quickly as possible I came up with a workaround that involves calling GetOrCompileView by reflection and a IViewCache implementation which writes the compiled assemblies to disk and loads them on subsequent starts. Rather hacky to say the least.
What I would like
Get some feedback if there is a more straightforward way to avoid repeated view compilation
If there is none, have better support in the Nancy framework for caching compiled Razor views
Steps to Reproduce
Create project with Nancy.Hosting.Self.NancyHost and RazorViewEngine with a route returning a Razor view
Start application
Open page in browser -> takes several seconds to respond
System Configuration
Nancy version: 2.0.0 (Nuget)
Nancy host
Nancy.Hosting.Aspnet
Nancy.Hosting.Self
Nancy.Owin ()
Other:
Other Nancy packages and versions: Nancy.ViewEngines.Razor 2.0.0
Environment (Operating system, version and so on): Windows 10
.NET Framework version: 4.5.2
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Prerequisites
DEBUG
andRELEASE
modeDescription
As mentioned in the thread #2866 compiling Razor views takes time. With the latest package from Nuget I found that launching the compiler for the first view takes 3-4 seconds and each additional view needs around 50 ms to compile.
This is an issue for a Nancy server in an application that users launch and expect to work with as quickly as possible. I understand that with the current Nancy architecture Razor views need to be compiled after each start of an application.
To ensure that a desktop application starts as quickly as possible I came up with a workaround that involves calling
GetOrCompileView
by reflection and aIViewCache
implementation which writes the compiled assemblies to disk and loads them on subsequent starts. Rather hacky to say the least.What I would like
Steps to Reproduce
Nancy.Hosting.Self.NancyHost
andRazorViewEngine
with a route returning a Razor viewSystem Configuration
The text was updated successfully, but these errors were encountered: