January 2006 - Posts

Supporting multiple hosts within one ASP.NET application

You may have seen the website in the guise of www.dotnetkicks.com, but it also can be viewed from the following domains: www.kick.ie, www.javakicks.com & www.mozillakicks.com. All of these hosts are mapped to the same ASP.NET application in IIS. This has a number of benefits:

- Reduced memory footprint - there is only one IIS application running for all four hosts
- Shared cache - As the AppDomain is the same for all four websites, the cache is shared
- Ease of deployment and maintenance - we are only dealing with one deployed application. Creating new sites on new hosts is also a snap - simply add the domain mapping in IIS and add a new row in the Host table in the database

The mapping from domain to application is achieved in IIS (you can test this on your development machine by adding a few host entries in your system32\drivers\etc\hosts file):

A Host table in our database defines a number of properties of each host including the MasterPage & Theme to use (currently all sites are using the same MasterPage) and whether to show ads or not. The host information is cached in memory for quick access and this cache is accessed early in the lifecycle of each incoming page request, allowing the resulting response to be customised for the host of the request.

Any subsequent calls to the Data Access Layer will include the HostID of the current request, allowing us to tailor the data for the specific host. You can see this by using your www.dotnetkicks.com login on the other sites too.

www.dotnetkicks.com - Alive and Kicking!!

I am pleased to announce the launch of DotNetKicks.com, a community driven news site specialising in Microsoft development technologies, the .NET framework & related tools and technologies.



Employing a similar concept to sites such as digg.com and shoutwire.com, DotNetKicks.com allows for non-hierarchical editorial control of stories. Anyone can submit a story, and anyone can 'kick' a story closer to publication on the homepage or main category feeds. The more kicks a story receives, the more likely it will appear on the homepage. 

Community driven sites such as this are nothing without an active user base, and we would like to invite you to register an account and start kicking. With your help, we are hoping that this site will quickly become a valuable resource for quality .NET news, tutorials and articles. 

We are also working on many great new features which will be added in the coming weeks and months.

More Posts