0

I have two web applications built on 2.0 and 4.0 frameworks. And i have link to 2.0 FW site from 4.0 FM site. So both are hosted on same IIS, but with different application pools. I am calling this site2.0 from site4.0 using iframe. So when i click a button to load this site2.0, it is taking so much time to load for the first time. Afterwards it loads as usual. Please suggest me if you have suggestions. I was thinking to use global.asax file and use Application_start event to load this site for the first time of site4.0 loads. But not sure how to do it.

Thanks

Tiger
  • 417
  • 2
  • 8
  • 23

1 Answers1

1

There are a few reasons to have latency on your requests:

If it's the first request, your site is merely JITing (known as Just In Time Compilation). This happens for the first invocation for any .NET application; running on IIS it manifests itself as a longer than normal first request. This is normal.

There are two ways to combat it:

  • "Pre Warm" your site by initiating a request right after deploy to cause the JITing (and view compilation) to occur.
  • Use a product like ngen to pre-JIT your site.

If you have latency on subsequent requests, then you need to profile your application. Ensure that it is built in 'Release' mode.

When the app pool is recycled, your site will have to re-JIT; this is normal. A keep alive task - an automated HTTP request utility (like a script that does a wget every so often) will keep your App Pool from recycling due to inactivity.

Community
  • 1
  • 1
George Stocker
  • 57,289
  • 29
  • 176
  • 237