In this article, we will get familiar with the new performance enhancement feature in ASP.Net 4 for preloading web applications. Introduction There are situations where Web applications can need large amounts of data to be loaded or require intensive initialization before the application can be operational. If no action is taken, this would result in a delay in the first request that an application receives. As a work-around, in earlier versions, developers would implement a mechanism to 'touch' the application or 'wake' up the application and process the initialization activities in the Application Load event in global.asax. This would enable the application entry requirements to be filled in, after an IIS restart or an application pool start-up occurs. ASP.Net 4 introduces a new built-in feature to provide this auto-start capability in the platform. This feature is available in the combination of ASP.Net 4, IIS 7.5 and Windows Server 2008 R2. Mechanics Here is the sequence flow for utilizing this new feature. The IIS Administrator sets an application pool to be automatically started by creating an application pool with the startMode set to "AlwaysRunning". Specify individual applications that will be auto-started Set serviceAutoStartEnabled to true for the Web application Specify the serviceAutoStartProvider The serviceAutoStartProvider is configured within the serviceAutoStartProviders section and can be set to a type which implements the IProcessHostPreLoadClient interface. When IIS restarts or the application pool is recycled, the serviceAutoStartProvider is instantiated and it's Process method is executed. Until the Process method is completed, the application is in a state in which it does not accept any HTTP requests. Once the preloading is completed and the Process method returns, the application is ready to process new requests. Benefits
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: