Friday, December 17, 2010

How to improve ASP.Net Performance 1: Check list for web.config file

1. Ensure Pages Are Batch Compiled
<compilation batch="true" />

2. Disable debug
<compilation debug="false" />

3. Disable Tracing
< trace enabled =”false” pageOutput="false"/>

4. If use IIS 7, please add following section into web config file to Cache static files
    <staticContent>
      <clientCache httpExpires="Sun, 29 Mar 2012 00:00:00 GMT" cacheControlMode="UseExpires" />
    </staticContent>

How to improve ASP.Net Performance 2- Coding guideline

- Check Page.IsPostBack to avoid unneccercery databinding
- Try use Repeater Control first. Viewstate in DataList, DataGrid, and DataView controls is huge sometime, although event handler is very covernient
- Prefer Transfer over Response.Redirect
- Check HttpResponse.IsClientConnected before performing a large operation