Continuous Learner #15

MVC
Globalization, Internationalization and Localization in ASP.NET MVC 3, JavaScript and jQuery – Part 1
http://bit.ly/ieAiDS

Windows Azure Pricing Calculator
http://bit.ly/kb1pKD

NuGet for the Enterprise: NuGet in a Continuous Integration Automated Build System
http://bit.ly/kHvvPX

Udi Dahan on CQRS, DDD and NServiceBus
http://bit.ly/kA9hlz

Google to Drop Support in Google Apps for Older Browsers
http://bit.ly/lnzxZO

WCF does not support compression out of the box, so fix it
http://bit.ly/kqoF34

Application Warm-Up Module for IIS7

This is another useful module for IIS that you can install from this page:http://www.iis.net/download/applicationwarmup.

This module will call a list of Urls every time the AppPool is recycled, making your site as responsive as possible from the first real http request.

After you have installed the module, you can configure the list of urls from the IIS:

image

image

Or you can configure the list from the web.config:

<system.webServer>
<httpWarmup>
<requests>
<add requestUrl="url1" allowedResponseCodes="200-399" warmupContext="" sendMode="Asynchronous" />
<add requestUrl="url2" allowedResponseCodes="200-399" warmupContext="" sendMode="Asynchronous" />
</requests>
</httpWarmup>
</system.webServer>

URL Rewrite Module for IIS7

At my workplace we had a project in beta for a while, and the address was something like beta.domain.com, and yesterday we finally released it to the public. The site in beta.domain.com has replaced the old site at www.domain.com, so we had to find a way to redirect all the users from beta.domain.com to www.domain.com.

We are running our site on a Windows 2008 R2 Standard OS, so we are using IIS 7.5.

My first attempt was with the HTTP Redirect module:

image

image

Basically I configured a 2nd website on my box, that respond to beta.domain.com and redirect all the calls to www.domain.com, and that kind of worked, but almost immediately I noticed a problem with it: it was not forwarding the query string from the beta domain to the live domain.

I decided to try with  URL Rewrite Module 2.0 for IIS 7 http://bit.ly/9MJy5J, so I fired up the Web Platform Installer, searched for the rewrite module and installed it.

image

It comes as a new feature in IIS.

image

Once you open the new feature, you can, with a few clicks, configure a canonical domain name that you want to use for that specific website, you can then configure multiple host names on the website and all the request will be 301 redirected to the unique canonical name that you really want to use for your site.

image

There’s obviously much more you can do with this URL Rewrite Module.
The module basically support all the configurations you can do with mod_rewrite in Apache, making http://www.isapirewrite.com/ obsolete.
On my home server I use it as a reverse proxy (when used in conjunction with Application Request Routing http://bit.ly/diPNwF) to redirect some custom domains to services hosted on other boxes I’ve got at home.

I invite you to read this list of articles http://learn.iis.net/page.aspx/737/url-rewrite-module-2/ to know more about it.