Below is the trace of my web page. This request is made after the browser is opened. However, When the page is refreshed, the init takes few milliseconds.After this, when i close the browser and open the page again, it is taki开发者_如何学Gong 1.5 to 2 secs. When i keep the browser idle for some 10 mins, and then try to load the page in same window, same tab, it take 1.5 to 2 seconds.
Could some one help me to find why is it taking long time, and how to fix it.. Thanks in advance.
The site is a "ASP.NET Website", running under IIS7. There are no compiled DLLs. We just host the code in IIS and it compiles when the page is requested for first time.
Thanks in Advance
aspx.page Begin PreInit
aspx.page End PreInit 1.4806351086E-05 0.000015
aspx.page Begin Init 3.2406353321E-05 0.000018
aspx.page End Init 2.01821376739222 2.018181
aspx.page Begin InitComplete 2.01825399596876 0.000040
aspx.page End InitComplete 2.01826936105008 0.000015
aspx.page Begin PreLoad 2.01828025628956 0.000011
aspx.page End PreLoad 2.01858532299496 0.000305
aspx.page Begin Load 2.01860404045766 0.000019
aspx.page End Load 3.1689460531995 1.150342
aspx.page Begin LoadComplete 3.1689762246319 0.000030
aspx.page End LoadComplete 3.16898879606207 0.000013
aspx.page Begin PreRender 3.16901561511309 0.000027
aspx.page End PreRender 3.17915796560736 0.010142
aspx.page Begin PreRenderComplete3.17918115291189 0.000023
aspx.page End PreRenderComplete 3.18084616899634 0.001665
aspx.page Begin SaveState 3.21169562053278 0.030849
aspx.page End SaveState 3.21362435728563 0.001929
aspx.page Begin SaveStateComplete3.21364670649482 0.000022
aspx.page End SaveStateComplete 3.21365816046453 0.000011
aspx.page Begin Render 3.21366849697378 0.000010
aspx.page End Render 3.28394558526293 0.070277
It could be lots of reasons for why you are having those performance issue. If you are not using a precompiled web it is normal that it takes longer to satisfy the first request. But after that if the user request the same resource it should be much quicker. It difficult answer you question because there could be lots of reasons why you are having this issue only if the user starts a new session :
- The browser could have cached the page or you are using any kind of output cache
- Your code could do something very heavy on the session_onStart
- we don't know what you do with each page events In general to improve the compilation time you could go for a an Asp.net precompiled web site but it not sure it will solve your issue
http://msdn.microsoft.com/en-us/library/399f057w%28v=vs.85%29.aspx
精彩评论