maniacneron
maniacneron

Reputation: 424

asp.net 4.0 application first time access too slow

i have a web application that developed using asp.net 4.0 and EF.But it's startup time is too slow 22 seconds.After that all pages is available in 1 second. i am publishing site after taking a clean release via vs 2010.What shoul i do to increase startup performance and decrease this time? in my webconfig:

<compilation debug="false" batch="false" >

Upvotes: 1

Views: 1443

Answers (1)

Ira Rainey
Ira Rainey

Reputation: 5209

Are you pre-compiling the site before publishing it or are you just uploading the .apx and code behind files?

The first time a page is accessed it needs to be compiled, so by pre-compiling it before publishing it can save a chunk of time when the page is first accessed. If you don't then it will get automatically compiled when accessed.

In terms of speed (first time accessed anyway) the order (fastest first) is:

  1. Pre-compiled non-updatable
  2. Pre-compiled updateable
  3. No pre-compilation

Setting debug="false" is also a good idea, which you are doing. If you have a production server and you don't require any debugging on it the you can also set the retail flag in machine.config which will force debug="false" for all sites by default.

<configuration>
    <system.web>
        <deployment retail="true"/>
    </system.web>
</configuration>

This will also disable page output trace and force custom error pages.

For more info:

http://www.asp.net/hosting/tutorials/precompiling-your-website-vb

Upvotes: 5

Related Questions