The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
A question I’ve received multiple times is “Why is it taking so long to load Sitefinity the first time after I recycle my application pool/restart my server/make change in my web.config file, etc"?
The answer is simple – it’s how .NET works!
Sitefinity is an ASP.NET web application. As such, the first time a user requests a resource from the website ASP.NET automatically compiles the application code and any dependent resources. Furthermore any application pool recycles, modifications in the source code or the top-level items of the application (such as the web.config, global.asax, etc) would cause ASP.NET to recompile the source files into assemblies. More info about ASP.NET’s application lifecycle can be found on MSDN.
So is there a way after a scheduled application pool recycle or change in the code for avoiding the first user to have to wait until the application recompiles? The answer is – yes, there is! It’s called application warm-up. It’s all about forcing the application to reinitialize after it has been restarted. It’s not something you do from within Sitefinity, just as recompilation doesn’t happen because of Sitefinity.
There are a couple of handy tools that work like a charm to achieve the required results:
1) Application Initialization for IIS 7.5 - IIS Application Initialization for IIS 7.5 enables website administrators to improve the responsiveness of their Web sites by loading the Web applications before the first request arrives.
Well, after giving it a try, it does do what it says on the tin! After installing it on your server, you can either configure forcing individual applications to reinitialize after an application pool recycle/server restart, or configure the applications to reinitialize after a soft reset (edits in web.config, etc).
In order to set up application warm-up after a recycle, you need to edit your %windir%\system32\inetsrv\config\applicationHost.config file and locate your <system.applicationHost> block. Edit the settings of the application you’d like to automatically initialize after a restart like this:
<
add
name
=
"MyApplicationPoolName"
autoStart="true"
startMode="AlwaysRunning"
managedRuntimeVersion="v4.0">
<
site
name
=
"MySiteName"
id
=
"#"
serverAutoStart
=
"true"
>
<
application
path
=
"/"
preloadEnabled
=
"true"
applicationPool
=
" MyApplicationPoolName "
>
2) Keep Alive Service For IIS 6.0/7.5 – the keep alive service requires no configuration, i.e. you install and forget about it. It monitors your IIS metabase and keeps all websites warm and quick.
So far I’ve been experimenting with these two and they seem to work pretty well.
Feel free to add your own tips, tricks and suggestions to the list!
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.