Link: http://scottwater.com/blog/archive/asp-net-web-config-tips-part-two/
1. Set DEBUG = "false" when releasing a product" <Compilation defaultlanguage = "C #" DEBUG = "false"/>
The disadvantage of true in debug is that the compilation page takes longer time, the code execution time is longer, and more memory is used during running.
2. If you cannot manage the product running environment, set the Program trust level to medium. <Trust level = "medium"/>
As more and more ISPs set the Asp.net trust level to medium, there are many things that cannot be done at this trust level.
3. Disable session state if no session is needed. <Sessionstate mode = "off"/>
Otherwise, the session information is included in each request.
4. Disable viewstate <Pages enableviewstate = "false"/>
5. Define custom controls so that they can be directly used on each page. <Pages>
<Controls>
<Add tagprefix = "cscontrol" namespace = "communityserver. Controls" assembly = "communityserver. Controls"/>
</Controls>
</Pages>
6. Define User Controls <Pages>
<Controls>
<Add tagprefix = "Monroe" tagname = "postview" src = "~ /Controls/postsview. ascx "/>
</Controls>
</Pages>
7. Use the configsource attribute <Connectionstrings configsource = "connectionstrings. config"/>
8. Use ashx instead of httphandlers <% @ Webhandler Language = "C #" class = "communityserver. Blogs. components. weblogrsshandler" %>
Ashx is suitable for processing RSS or images for a single purpose.