@philjones and @sjonge were waiting 10-20secs for their Razor views to render and @grumpydev came up with the below gist to fix it.
Not sure what the plan is in fixing it in the long run, I'll do a PR if you let me know what you need doing.
The main problem with this work around is that something is cached so that if you change a cshtml, you have to build/rebuild the Visual Studio solution for the change to show up.
I think @jchannon needs to make his next PR for Nancy fixing this or upgrading to the full Razor engine ;-)
@philjones88 can you make a small repro project for this please? It is specifically partials that cause it? I'm still at a loss why the per request cache makes any difference :/
Tried my best, got it to take 2.70 seconds, not really near my 18 seconds but then I have lots of HTML and more on my Model...
@philjones88 are you using cassette?
@prabirshrestha I was at the time, now switched to squishit. I need to remove all of Grumpys hacks and see if that makes a difference. But we just had another person in Jabbr complaining about the razor speed, so probably cassette was 1-2 at most.
you could try searching in google groups. cassette really did decrease the speed. i have noticed that too.
Well the real solution to this is file based cache invalidation (in debug at least), but I'm not sure that's going to be coming any time soon, so I was hoping for a quick win.
The thing that confused me the most was hacking it to do a cache per request sped it up massively.. which doesn't make any sense at all unless you're referring to the same partial over and over again.