When should one use a 'www' subdomain?

There are a ton of good reasons to include it, the best of which is here: Yahoo Performance Best Practices

Due to the dot rule with cookies, if you don't have the 'www.' then you can't set two-dot cookies or cross-subdomain cookies a la *.example.com. There are two pertinent impacts.

First it means that any user you're giving cookies to will send those cookies back with requests that match the domain. So even if you have a subdomain, images.example.com, the example.com cookie will always be sent with requests to that domain. This creates overhead that wouldn't exist if you had made www.example.com the authoritative name. Of course you can use a CDN, but that depends on your resources.

Also, you then don't have the ability to set a cross-subdomain cookie. This seems evident, but this means allowing authenticated users to move between your subdomains is more of a technical challenge.

So ask yourself some questions. Do I set cookies? Do I care about potentially needless bandwidth expenditure? Will authenticated users be crossing subdomains? If you're really concerned with inconveniencing the user, you can always configure your server to take care of the www/no www thing automatically.

See dropwww and yes-www.


Just after asking this question I came over the no-www page which says:

...Succinctly, use of the www subdomain is redundant and time consuming to communicate. The internet, media, and society are all better off without it.


Take it from a domainer, Use both the www.domainname.com and the normal domainname.com otherwise you are just throwing your traffic away to the browers search engine (DNS Error)

Actually it is amazing how many domains out there, especially amongst the top 100, correctly resolve for www.domainname.com but not domainname.com