0

hope this is an easy one. I've googled all over to find the answer to this, but have only come up with C# instructions. I can't seem to correlate/find the files that are mentioned to implement this. Any quick direction?

HumbleBeginnings
  • 1,009
  • 10
  • 22
  • More searching revealed some answers here: http://stackoverflow.com/questions/5500078/can-razor-views-be-compiled. I'm using VS2015 and, to be honest, unless I am doing something wrong, I don't see ANY increase in speed on the first hit to each rendered page. So I wind up continuing to MANUALLY go to each page to make it faster the subsequent. Surely, there must be a better approach...? – HumbleBeginnings Apr 26 '16 at 02:37

1 Answers1

0

Publish you web app and change the settings to precompile the application. Menu->Build->Publish XYZ->Create Profile->Select connection->Settings->File Publish Options->Precompile during publishing (Check), click on configure to configure more.

enter image description here

Edit:

In advanced precompile settings, uncheck the updatable option. Merge all output to single assembly. Check Treat as library component.

enter image description here

Yes I do see some improvement in the first call to website after AppPool starts. Rest all is same.

Sarvesh Mishra
  • 2,014
  • 15
  • 30
  • Yes - I've done that (per my comment to my original post), but as I said I still see NO speed improvement. Assuming you've used this - do you see a first-hit performance increase? – HumbleBeginnings Apr 26 '16 at 05:10
  • This is incorrect. The "Precompilation" settings in Visual Studio Web Application projects only apply to ASP.NET Web Forms files (`.aspx`, `.ascx`, `.asax`, `.ashx`, `.asmx`) and not to Razor files (`.cshtml`, `.vbhtml`). For that you need a separate tool like RazorGenerator (in the VS Extensions gallery). – Dai Jun 24 '17 at 07:59