Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Commented Unassigned: Why first request still very slow?? [142]

$
0
0
I'm look at the article: http://stacktoheap.com/blog/2013/01/19/precompiling-razor-views-in-asp-dot-net-mvc-3/

and add the new version Razor generator Extends on visual studio 2012, I'm also add Nuget packege:RazorGenerator.mvc and RazorGenerator.MsBuild to my mvc4 project.

I find there is auto add a class, and it can auto execute when application start debug.

```
public static class RazorGeneratorMvcStart {
public static void Start() {
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) {
UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal
};

ViewEngines.Engines.Insert(0, engine);

// StartPage lookups are done by WebPages.
VirtualPathFactoryManager.RegisterVirtualPathFactory(engine);
}
```


But I'm not changed anything, the new version Something different with the article . like RazorGenerator.targets , So I don't changed anything.

and I also not add the RazorGenerator content to custom tools of .csthml file property, because the artile not like me use it . But when I debug , every thing fine , there is .cs file auto generate on obj/ folder all from Razor view.

I also add this on my .csproj file like the article said:

```
Target Name="BeforeBuild">
<ItemGroup>
<Content Remove="Views\**\*.cshtml" />
<None Include="Views\**\*.cshtml" />
</ItemGroup>
</Target>
```



and I publish my project use visual studio vs2012(remove recompile option on the publish)

and use IIS open . but ....the first request still very slow.......

Am I miss or the new version some changed? the view can normal open, but why the first request still slow?

specially when first request(not access view still very slow).

Why can't let the all class loading when the IIS start the website??

thanks , and sorry for my bad english.
Comments: I have similar issue, but it is not related to Razorgenerator but to IIS. First of all check asp compiler; when you are using Publish and precompilation it compiling as x86. And it cannot be changed. MS Connect issue states -> cannot be repaired. So if you use x64 then you need precompile web from some kind of batch scripting. Second of all, even if application is precompiled, IIS still makes some internal precompilation and put that compiled to its own temp folders, that are cleared on start or recycle. I solved long start issue by changed Web Pool to x32 because starting it on x63 cause so big memory peek thet ended with out of memory exception even for quite small web site. This is ridiculous, but I didn't find the way how to solve this other way.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>