views:

131

answers:

3

Hi i have deployed one of our asp.net website at windows 2003 server.

When i request default page then always first responseof session takes more time. I think due to image rendring/ css and javascript .

Is there any way to make response as fast as possible. Also in my default.aspx i am using 6 web parts and 6 user controls one for each web parts.

+1  A: 

The first request to a asp.net site will trigger the site compilation. There are options introduced in visual studio 2005 that allow you to pre compile the site before deploying it which would avoid the initial delay in serving the first page.

This article has more information on exactly what happens during the first request. http://www.odetocode.com/Articles/417.aspx

benophobia
+1  A: 

The first request for a web application to IIS will always take more time, because it has to start the application and compile the ASPX files. It will also have to execute code to do with application startup, such as Application_Start in Global.asax.

You can't entirely solve this issue, but you can get around it by pre-compiling the web site, doing initialisation in the background if possible and making sure that compilation debug is set to false in your web.config file.

Coxy
+1  A: 

If I understand correctly (and I frequently don't), the first request to an ASP.NET app has to compile the app into CLI, which take a little longer than the subsequent requests. Images and CSS/JS will have minimal impact in the scheme of things.

You can try pre-compilation or tweaking the app pool settings to minimise the impact (reduce the number of worker process recycles, etc), but you will always run into this with the very first request of an app/page aftter the app starts up.

Beyond that, look into caching, optimising your output (for example, minimise the number of HTTP requests, gzip compression on output from the server). This will benefit your end users.

As mentioned, make sure debug="false" is set in your web.config, i.e.

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

It's amazing the difference this small change can make.

Chris