IIS Site Warmup

Home / Blog / IIS Site Warmup

IIS Site Warmup

Posted:  April 12, 2012

IIS Site Warmup

Hey folks, ’bout time for me to come around with a little tip.

Thanks to IIS 7.5 Extensions and Microsoft (well… really Windows 8, and IIS 8 I guess…), we can now prime our Application Pools, when IIS starts.

Now, though it would be nice to be able to simply plug it in and go, unfortunately this is not the case, and there is some configuring to do.

Please see here: http://learn.iis.net/page.aspx/1089/iis-80-application-initialization/

Now, this article is not about the IIS extension, this is about priming or warming up your site.

Now, this is not a necessity, but if you are like me, you take advantage of .Net’s Runtime.Caching, so simply priming your App Pools may not be enough. My SRE (Site Rendering Engine) for one highly utilizes the server’s in memory cache, as well as the Runtime.Cache, so the very first load takes a bit.

When we can prime the site itself, we can ensure that hits to it after the fact will be quick. Thus the need for a WarmUp.

What I’ve done is pretty simple, yet extremely effective in doing just this. All it does is fire up a WebClient, passes a valid User-Agent header, and pulls the site.

Here is some code for you all. Mind you it is a VS 2010 project, so I will attach the source files as well. Make sure to modify the Settings.xml file, just replace the url and page attributes with whatever you need to prime, you can add as many sites as you need.

It is a console application, so there are no buttons to push, there are 2 classes, and a settings file.

AuditManager.vb

Public Class AuditManager

 Public Enum AuditType
 Exception
 General
 End Enum

 Public Shared Function GetPath() As String
 Return System.AppDomain.CurrentDomain.BaseDirectory()
 End Function

 Public Shared Sub Write(ByVal _Type As AuditType?, ByVal _Description As String, Optional ByVal _Location As String = Nothing, Optional ByVal _Except As Exception = Nothing)
 Dim _Stack As System.Diagnostics.StackTrace
 If _Except IsNot Nothing Then
 _Stack = New System.Diagnostics.StackTrace(_Except, True)
 Else
 _Stack = Nothing
 End If
 Using _F As New IO.StreamWriter(GetPath() & FormatDateTime(Date.Now, DateFormat.ShortDate).Replace("/", String.Empty) & ".LOG", True)
 Dim tmpString As New Text.StringBuilder
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("WHEN:" & vbCrLf)
 tmpString.Append(Date.Now & vbCrLf)
 If _Type.HasValue Then
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("TYPE:" & vbCrLf)
 tmpString.Append([Enum].GetName(GetType(AuditType), _Type) & vbCrLf)
 End If
 If _Location IsNot Nothing Then
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("LOCATION:" & vbCrLf)
 tmpString.Append(_Location & vbCrLf)
 End If
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 If _Stack IsNot Nothing Then
 tmpString.Append("STACKTRACE:" & vbCrLf)
 tmpString.Append(_Stack.ToString() & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("STACK FRAMES:" & vbCrLf)
 For Each frame In _Stack.GetFrames()
 tmpString.Append(" - FILE:" & frame.GetFileName() & vbCrLf)
 tmpString.Append(" - METHOD:" & frame.GetMethod().Name & vbCrLf)
 tmpString.Append(" - LINE:" & frame.GetFileLineNumber() & vbCrLf)
 tmpString.Append(" - COLUMN:" & frame.GetFileColumnNumber() & vbCrLf)
 Next
 End If
 If _Except IsNot Nothing Then
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("SOURCE:" & vbCrLf)
 tmpString.Append(_Except.Source & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("MESSAGE:" & vbCrLf)
 tmpString.Append(_Except.Message & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("DATA:" & vbCrLf)
 tmpString.Append(_Except.Data.ToString() & vbCrLf)
 End If
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("NOTES:" & vbCrLf)
 tmpString.Append(_Description & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 _F.Write(tmpString.ToString())
 _F.Close()
 End Using
 End Sub

End Class

WarmUpService.vb

Imports System.Reflection
Imports System.IO
Imports System.Net
Imports System.Threading.Tasks

Module WarmUpService

 Private _SiteList As New List(Of Typing)

 Public Sub Main()
 AuditManager.Write(AuditManager.AuditType.General, "Fireing Up...")
 DoTheWarmUp()
 AuditManager.Write(AuditManager.AuditType.General, "All Set...")
 End Sub

 Private Sub DoTheWarmUp()
 Try
 Parallel.Invoke(Sub()
 SetAllowUnsafeHeaderParsing20()
 End Sub,
 Sub()
 Dim _X As XElement = XElement.Load(AuditManager.GetPath() & "Settings.xml")
 _SiteList = (From n In _X...<Site>.AsParallel()
 Select New Typing() With {
 .Page = n.@page,
 .Url = n.@url
 }).ToList()
 Parallel.ForEach(_SiteList, Sub(Item)
 Using _WC As New WebClient()
 _WC.Headers.Add("user-agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13")
 _WC.DownloadData(Item.Url & Item.Page)
 End Using
 End Sub)
 End Sub)
 Catch ex As Exception
 AuditManager.Write(AuditManager.AuditType.Exception, "There was an issue!", "DoTheWarmUp", ex)
 End Try
 End Sub

 Private Sub SetAllowUnsafeHeaderParsing20()
 Dim a As New System.Net.Configuration.SettingsSection
 Dim aNetAssembly As System.Reflection.Assembly = Assembly.GetAssembly(a.GetType)
 Dim aSettingsType As Type = aNetAssembly.GetType("System.Net.Configuration.SettingsSectionInternal")
 Dim args As Object() = Nothing
 Dim anInstance As Object = aSettingsType.InvokeMember("Section", BindingFlags.Static Or BindingFlags.GetProperty Or BindingFlags.NonPublic, Nothing, Nothing, args)
 Dim aUseUnsafeHeaderParsing As FieldInfo = aSettingsType.GetField("useUnsafeHeaderParsing", BindingFlags.NonPublic Or BindingFlags.Instance)
 aUseUnsafeHeaderParsing.SetValue(anInstance, True)
 End Sub

 Partial Public Class Typing
 Public Property Url As String
 Public Property Page As String
 End Class

End Module

Settings.xml

<Settings>
 <Site url="http://www.o7thwebdesign.com" page="/" />
 <Site url="http://www.facchinifacchinipa.com" page="/" />
 <Site url="http://skor.in" page="/" />
 <Site url="http://o7t.in" page="/" />
</Settings>

WarmUpService Source Code – Visual Studio 2010 Project

Kevin Pirnie

20+ Years of PC and server maintenance & over 15+ years of web development/design experience; you can rest assured that I take every measure possible to ensure your computers are running to their peak potentials. I treat them as if they were mine, and I am quite a stickler about keeping my machines up to date and optimized to run as well as they can.

Cookie Notice

This site utilizes cookies to improve your browsing experience, analyze the type of traffic we receive, and serve up proper content for you. If you wish to continue browsing, you must agree to allow us to set these cookies. If not, please visit another website.

IIS Site Warmup

Hey folks, ’bout time for me to come around with a little tip.

Thanks to IIS 7.5 Extensions and Microsoft (well… really Windows 8, and IIS 8 I guess…), we can now prime our Application Pools, when IIS starts.

Now, though it would be nice to be able to simply plug it in and go, unfortunately this is not the case, and there is some configuring to do.

Please see here: http://learn.iis.net/page.aspx/1089/iis-80-application-initialization/

Now, this article is not about the IIS extension, this is about priming or warming up your site.

Now, this is not a necessity, but if you are like me, you take advantage of .Net’s Runtime.Caching, so simply priming your App Pools may not be enough. My SRE (Site Rendering Engine) for one highly utilizes the server’s in memory cache, as well as the Runtime.Cache, so the very first load takes a bit.

When we can prime the site itself, we can ensure that hits to it after the fact will be quick. Thus the need for a WarmUp.

What I’ve done is pretty simple, yet extremely effective in doing just this. All it does is fire up a WebClient, passes a valid User-Agent header, and pulls the site.

Here is some code for you all. Mind you it is a VS 2010 project, so I will attach the source files as well. Make sure to modify the Settings.xml file, just replace the url and page attributes with whatever you need to prime, you can add as many sites as you need.

It is a console application, so there are no buttons to push, there are 2 classes, and a settings file.

AuditManager.vb

Public Class AuditManager

 Public Enum AuditType
 Exception
 General
 End Enum

 Public Shared Function GetPath() As String
 Return System.AppDomain.CurrentDomain.BaseDirectory()
 End Function

 Public Shared Sub Write(ByVal _Type As AuditType?, ByVal _Description As String, Optional ByVal _Location As String = Nothing, Optional ByVal _Except As Exception = Nothing)
 Dim _Stack As System.Diagnostics.StackTrace
 If _Except IsNot Nothing Then
 _Stack = New System.Diagnostics.StackTrace(_Except, True)
 Else
 _Stack = Nothing
 End If
 Using _F As New IO.StreamWriter(GetPath() & FormatDateTime(Date.Now, DateFormat.ShortDate).Replace("/", String.Empty) & ".LOG", True)
 Dim tmpString As New Text.StringBuilder
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("WHEN:" & vbCrLf)
 tmpString.Append(Date.Now & vbCrLf)
 If _Type.HasValue Then
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("TYPE:" & vbCrLf)
 tmpString.Append([Enum].GetName(GetType(AuditType), _Type) & vbCrLf)
 End If
 If _Location IsNot Nothing Then
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("LOCATION:" & vbCrLf)
 tmpString.Append(_Location & vbCrLf)
 End If
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 If _Stack IsNot Nothing Then
 tmpString.Append("STACKTRACE:" & vbCrLf)
 tmpString.Append(_Stack.ToString() & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("STACK FRAMES:" & vbCrLf)
 For Each frame In _Stack.GetFrames()
 tmpString.Append(" - FILE:" & frame.GetFileName() & vbCrLf)
 tmpString.Append(" - METHOD:" & frame.GetMethod().Name & vbCrLf)
 tmpString.Append(" - LINE:" & frame.GetFileLineNumber() & vbCrLf)
 tmpString.Append(" - COLUMN:" & frame.GetFileColumnNumber() & vbCrLf)
 Next
 End If
 If _Except IsNot Nothing Then
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("SOURCE:" & vbCrLf)
 tmpString.Append(_Except.Source & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("MESSAGE:" & vbCrLf)
 tmpString.Append(_Except.Message & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("DATA:" & vbCrLf)
 tmpString.Append(_Except.Data.ToString() & vbCrLf)
 End If
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 tmpString.Append("NOTES:" & vbCrLf)
 tmpString.Append(_Description & vbCrLf)
 tmpString.Append("-------------------------------------------------" & vbCrLf)
 _F.Write(tmpString.ToString())
 _F.Close()
 End Using
 End Sub

End Class

WarmUpService.vb

Imports System.Reflection
Imports System.IO
Imports System.Net
Imports System.Threading.Tasks

Module WarmUpService

 Private _SiteList As New List(Of Typing)

 Public Sub Main()
 AuditManager.Write(AuditManager.AuditType.General, "Fireing Up...")
 DoTheWarmUp()
 AuditManager.Write(AuditManager.AuditType.General, "All Set...")
 End Sub

 Private Sub DoTheWarmUp()
 Try
 Parallel.Invoke(Sub()
 SetAllowUnsafeHeaderParsing20()
 End Sub,
 Sub()
 Dim _X As XElement = XElement.Load(AuditManager.GetPath() & "Settings.xml")
 _SiteList = (From n In _X...<Site>.AsParallel()
 Select New Typing() With {
 .Page = n.@page,
 .Url = n.@url
 }).ToList()
 Parallel.ForEach(_SiteList, Sub(Item)
 Using _WC As New WebClient()
 _WC.Headers.Add("user-agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13")
 _WC.DownloadData(Item.Url & Item.Page)
 End Using
 End Sub)
 End Sub)
 Catch ex As Exception
 AuditManager.Write(AuditManager.AuditType.Exception, "There was an issue!", "DoTheWarmUp", ex)
 End Try
 End Sub

 Private Sub SetAllowUnsafeHeaderParsing20()
 Dim a As New System.Net.Configuration.SettingsSection
 Dim aNetAssembly As System.Reflection.Assembly = Assembly.GetAssembly(a.GetType)
 Dim aSettingsType As Type = aNetAssembly.GetType("System.Net.Configuration.SettingsSectionInternal")
 Dim args As Object() = Nothing
 Dim anInstance As Object = aSettingsType.InvokeMember("Section", BindingFlags.Static Or BindingFlags.GetProperty Or BindingFlags.NonPublic, Nothing, Nothing, args)
 Dim aUseUnsafeHeaderParsing As FieldInfo = aSettingsType.GetField("useUnsafeHeaderParsing", BindingFlags.NonPublic Or BindingFlags.Instance)
 aUseUnsafeHeaderParsing.SetValue(anInstance, True)
 End Sub

 Partial Public Class Typing
 Public Property Url As String
 Public Property Page As String
 End Class

End Module

Settings.xml

<Settings>
 <Site url="http://www.o7thwebdesign.com" page="/" />
 <Site url="http://www.facchinifacchinipa.com" page="/" />
 <Site url="http://skor.in" page="/" />
 <Site url="http://o7t.in" page="/" />
</Settings>

WarmUpService Source Code – Visual Studio 2010 Project

Our Privacy Policy

Last Updated: June 18th, 2025

Introduction

Western Mass Hosting (“we,” “our,” or “us”) respects the privacy of all individuals and organizations that interact with our services. This Privacy Policy establishes our practices regarding the collection, use, disclosure, and protection of personal information for visitors to our website and clients utilizing our managed hosting and WordPress services. By accessing our website or engaging our services, you acknowledge that you have read and understood this policy in its entirety.

Scope and Applicability

This Privacy Policy governs our handling of information collected through our corporate website and in the course of providing managed hosting, WordPress maintenance, and development services. In accordance with global privacy regulations, we serve as a Data Controller for information related to our business operations and client relationships. When processing data on behalf of our clients through hosted services, we act as a Data Processor under applicable data protection laws.

Information We Collect

We collect various categories of information necessary to provide and improve our services. This includes personal contact and payment details provided during account registration, technical information such as IP addresses and device characteristics for security purposes, and records of communications through support channels. For clients utilizing our hosting services, we may process end-user data stored within client websites, though we do not control or monitor the collection practices of such data.

Purpose and Legal Basis for Processing

We process personal information only when we have proper justification under applicable laws. The primary legal bases for our processing activities include the necessity to fulfill contractual obligations to our clients, our legitimate business interests in maintaining and improving our services, and in limited cases, explicit consent for specific marketing communications. We maintain detailed records of processing activities to demonstrate compliance with legal requirements.

Use of Collected Information

The information we collect serves multiple business purposes. Primarily, we use this data to deliver and maintain reliable hosting services, including server provisioning, performance monitoring, and technical support. We also utilize information for business operations such as billing, customer relationship management, and service improvement initiatives. Security represents another critical use case, where we analyze data to detect and prevent fraudulent activity or unauthorized access to our systems.

Data Sharing and Third-Party Disclosures

We engage with carefully selected third-party service providers to support our operations, including cloud infrastructure providers, payment processors, and customer support platforms. These relationships are governed by strict contractual agreements that mandate appropriate data protection measures. We may disclose information when legally required to comply with court orders, government requests, or to protect our legal rights and the security of our services.

International Data Transfers

As a global service provider, we may transfer and process data in various locations worldwide. When transferring personal data originating from the European Economic Area or other regulated jurisdictions, we implement appropriate safeguards such as Standard Contractual Clauses and rely on adequacy decisions where applicable. Our subprocessors, including AWS Lightsail, maintain robust compliance certifications to ensure the protection of transferred data.

Data Retention Practices

We retain personal information only for as long as necessary to fulfill the purposes outlined in this policy. Client account information is typically maintained for five years following service termination to comply with legal and financial reporting obligations. Backup data associated with hosting services is automatically purged after thirty days, as specified in our Terms of Service. For data processed on behalf of clients, retention periods are determined by the respective client’s policies and instructions.

Security Measures

We implement comprehensive technical and organizational security measures to protect personal information against unauthorized access, alteration, or destruction. Our security program includes network encryption protocols, regular vulnerability assessments, strict access controls, and employee training on data protection best practices. We maintain incident response procedures to address potential security breaches and will notify affected parties where required by law.

Individual Rights

Individuals whose personal data we process may exercise certain rights under applicable privacy laws. These rights may include requesting access to their information, seeking correction of inaccurate data, requesting deletion under specific circumstances, and objecting to particular processing activities. We have established procedures to handle such requests in accordance with legal requirements, typically responding within thirty days of receipt. Requests should be submitted to our designated Data Protection Officer through the contact information provided in this policy.

Cookies and Tracking Technologies

Our website employs various technologies to enhance user experience and analyze site performance. Essential cookies are used for basic functionality and security purposes, while analytics cookies help us understand how visitors interact with our site. Marketing cookies are only deployed with explicit user consent. Visitors can manage cookie preferences through their browser settings or our cookie consent tool.

Policy Updates and Notifications

We periodically review and update this Privacy Policy to reflect changes in our practices or legal obligations. Material changes will be communicated to affected clients through email notifications at least thirty days prior to implementation. Continued use of our services following such notifications constitutes acceptance of the revised policy.

Contact Information

For questions or concerns regarding this Privacy Policy or our privacy practices, please contact our Data Protection Officer at info@westernmasshosting.com or by mail at:

Western Mass Hosting
22 Orlando. St.,
Feeding Hills, MA 01030.

We take all privacy-related inquiries seriously and will respond promptly to legitimate requests. For clients with specific data processing agreements, please reference your contract for any additional terms that may apply to our handling of your data.