0

I am using ASP.NET MVC5 and Visual Studio 2015 for own web application. My application is deployed on the IIS 8.5 server. I have very slow performance during first loading of the each page. The next each request for the specific page is very fast. I think that this is due to compilation of the page. Please help me, how i can setup pre-compilation of the views during publishing process on the build server?

Olexiy Kubliy
  • 21
  • 1
  • 6

2 Answers2

0

The question here is, how heavy are you pages, it sounds to me browser caching is making the pages faster on your second call. it dosnt to do anything with IIS. in IIS the first load is always slow once the project gets built the next requests will be quick.

so I suggest look at your view, optimize images and scripts and etc...

eric_eri
  • 699
  • 11
  • 19
  • The problem appeared after i migrated my application from MVC4 and .NET 4.5 framework(VS2012) to MVC5 and .NET 4.6 framework(VS2015). I can not setup pre-compilation of the views in new publishing process, although it worked in the old enviroment. For publishing my application i use the following command: – Olexiy Kubliy Oct 22 '15 at 20:56
  • And in Web.csproj file i set property PrecompileBeforePublish to true. – Olexiy Kubliy Oct 22 '15 at 20:59
  • With this property in old enviroment after publishing i received many *.compiled files in the /bin output folder and first page load was very fast. But i cannot setup pre-compilation of the views it the new enviroment. After publishing i not see any *.compiled file in /bin folder and each page is compiled during first request. – Olexiy Kubliy Oct 22 '15 at 21:09
0

We use Razor Generator for this, it's a VS extension.

Wills
  • 11
  • 4
  • Early we used aspnet_compiler to precompile views, but it does not work for me with MVC5. Can you explain difference(pros and cons) between aspnet_compiler and Razor Generator? And maybe you know why aspnet_compiler does not work with MVC5? – Olexiy Kubliy Oct 23 '15 at 08:31