Initializing an ASP.NET web application (first hit) takes more than 15 minutes.

I have a web application ( http://www.holidaystreets.com ), it has about 120,000 + pages. Whenever we restart the server, it takes more than 15 minutes to warm up the site. I built it as "Release", it does not have any heavy initialization (for example, control adapters or APPInit). Any tips?

The mystery is solved. Well, I noticed a problem today. This application has been converted from a project of type WebSite to type WebApplication. I had a coddom defined in web.config so that I could compile each page separately on request for the first time. (this was done because we had such a huge number of pages). However, in WebApplication, it compiled every page on first load. After deleting a section, the application loads in less than 2 seconds!

+4
source share
3 answers

You probably have a lot of static data that was triggered on the first hit. Look for the large amount of cached data that you use in static classes (perhaps getting it from db?).

+2
source

I would suggest using the methods of the System.Diagnostic.Trace class to register timings for various methods and events, since your site loads for the first time to find out where the time is spent. Also, profiling your database should reveal any bottlenecks there.

+2
source

I returned it to 2.65s:

http://www.webpagetest.org/test

+1
source

Source: https://habr.com/ru/post/1302365/


All Articles