Deploying Asp.Net Code to Production with compilation debug=”true”

This is an extract for my reference from ScottGu article on Don’t run production ASP.NET Applications with debug=”true” enabled

What happens when you deploy web application to production with debug=”true” in the web.config file

1) The compilation of ASP.NET pages takes longer (since some batch optimizations are disabled)

2) Code can execute slower (since some additional debug paths are enabled)

3) Much more memory is used within the application at runtime

4) Scripts and images downloaded from the WebResources.axd handler are not cached

How to avoid accidentally deploys with <compilation debug=”true”/>

Do the below setting in machine.config file:

<configuration>

<system.web>

<deployment retail=”true”/>

</system.web>

</configuration>