views:

325

answers:

1

Hi,

We use IIS to host our Visual Studio 2008 apps (ASP.NET 2/3.5) on localhost as opposed to Cassini.

The only problem with this approach (I'm using IIS7 on Windows 7, but the problem also exists on XP with IIS 5.1) is that after each compilation IIS takes 1 whole minute to respond to the first request. I assume it's doing its own compiling or something.

Is there anything I can do to speed this up?

Every time I make a code change and recompile I have to wait a minute.

Please don't suggest using Cassini, I am interested in responses on how to speed up localhost with IIS!

A: 

IIS is doing its own compile when you first visit the website, and that's what's causing this delay. I think IIS compiles on-demand, though, so I'm surprised to hear that it's taking a full minute to view the first page.

How's the disk performance on the web server - is it generally slow, or full/fragmented? Is there memory contention? The first step would be to see if there's some way you can augment the resources available in that server - either by adding more or by stopping/moving any unnecessary services - to see if that helps.

If that doesn't have an impact on the compile time when you first visit, you can try adding a step to your build process that visits the website in the background, which would cause it to pre-compile. It wouldn't do away with your wait time, but it would start the compile immediately, so the site is available as soon as possible. You can read about custom build steps at MSDN: http://msdn.microsoft.com/en-us/library/ms366724(VS.80).aspx

I'm interested to know what solves this problem.

rwmnau