I have asked this question ever before and it seems I didn't 100% resolved it. Please see link A search aspx page return slow, I disable the IIS logs, but it seems still load slowly.
I have a asp.net website, there is a searchResult.aspx, it runs a sql script to retrieve data from MS SQL server database, and then put the data into a HTML format, the website has been deployed in IIS7.5 Server. I have implemented both static and dynamic compression, that means all my js, css and aspx page have been compressed before rendered to browser.
Unfortunately the searchResult.aspx return very slow, if search for a big word, like biography, it averagely takes more than 10 seconds to return. and I used firebug Net to trace it, the blocking, DNS Lookup, Connecting and Sending all take no more than 10ms, but the Waiting takes over 10 seconds. So I added some code to the beginning and end of function Page_Load(object sender, EventArgs e) and also the begining and end of HTML body element, like below:
protected Stopwatch stopwatch = new Stopwatch();
protected void Page_Load(object sender, EventArgs e)
{
stopwatch.Start();
....
stopwatch.Stop();
timeForSearch = stopwatch.Elapsed.Milliseconds;
}
<body>
<%
stopwatch.Reset();
stopwatch.Start();
%>
....
<%stopwatch.Stop();%>
<%=timeForSearch%>+<%=stopwatch.Elapsed.Milliseconds%>= <%=stopwatch.Elapsed.Milliseconds + timeForSearch%>
OK, you can see the pic, the highlight is the millinseconds elapsed, but why it took 4.8 seconds to load.
Any help will be appreciated.