|
|
|
|
|
by kalleboo
4382 days ago
|
|
Another thing to consider is parallel downloads. Last I checked, all browsers limited simultaneous HTTP calls to a single domain. Spreading downloads across domains will increase multithreaded downloading, which on most connections will increase speeds. |
|
In contrast, the speed of a DNS query is relatively fixed – that initial lookup can take a long time on a cold cache (possibly seconds, particularly internationally) and nothing will transfer until it's completed, so you really need to calculate the time to last byte with that in mind. If you're talking about small, cached files, domain sharding is often a significant step back if the entire transfer can complete over an existing connection in the time it takes to perform DNS + connection for a new hostname. This is particularly interesting when you remember that modern browsers can do DNS prefetching really early so e.g. DNS for your primary domain was completed before someone even clicked on the link and multiple connections were opened as soon as they clicked.
Steve Souders looked at this last year:
http://www.stevesouders.com/blog/2013/09/05/domain-sharding-...
> A middle ground is to alter domain sharding depending on the client: 1 domain for browsers that support SPDY, 2 domains for non-SPDY modern browsers, 3-4 domains for IE 6-7. This makes domain sharding harder to deploy. It also lowers the cache hit rate on intermediate proxies.
1. interestingly, CDNJS has supported SPDY for 2 years: https://twitter.com/cdnjs/status/231227466335797249