Let me explain what I mean. The problem arose when I developed a web based application. I needed to choose whether I will use a web site or a web application. After doing a little reading, I selected to go with the web site because of the new dynamic compilation and etc. Soon enough my application grew and my web site had about 100 pages, my App_Code folder had about 50 classes and my images folder weighed somewhere around 25 MB.
The thing that I noticed during the application development stages is that each week the compilation process is taking longer and longer. At the beginning it only took couple of seconds and now for each compilation I am taking five long minutes and go drinking coffee. This has become a regular scenario and a solution had to be found.
After investigating I found out that the thing is, that this is actually a known issue. Compilation can take quite some time to complete when choosing a web site application. So how can we improve it? I gathered some strategies that can improve performance for the compilation in a web site application.
1. Try to avoid adding code to the App_Code folder and instead use an external assembly that will hold the code.
2. Remove all unneeded assemblies, references and images.
3. Remove batch build if exists.
4. Use an "on demand compilation".
5. Hide all static folders in the project.
Once I implemented all of the above, my coffee breaks gotten shorter 