According to this message in the AWS forums, I should serve my static assets from different hostnames because I can achieve more parallel downloads with the client's browser, do I need a totally different TLD, or will unique subdomains (like: static1.example.com
, static2.example.com
) work?
Separate hostnames within one TLD will work, and is the traditional approach.
That said, there's a good reason to use a different TLD: cookies. If you're serving user-supplied files, you definitely want a different TLD with no access to the sign-in cookies.
Even for trusted content, if you have cookies over a domain
.example.com
, then avoiding serving the images/whatever from inside.example.com
leads to lighter requests and responses. How much this matters depends upon how carefully you're tuning performance to keep overheads small and how bloated your set of all cookies is.The trade off is between parallel requests and additional DNS requests, note many modern browsers have upped the limit from 2 to 6 or so.
http://developer.yahoo.com/performance/rules.html#dns_lookups