Been doing some #optimization on my site. Seems to be working! • • • • #wprocket #domainsharding #minification #prefetch #maxcdn #cloudflare #imagecompression
seen from Georgia
seen from Bangladesh

seen from United States
seen from United States
seen from United States
seen from India
seen from United States
seen from United States
seen from China

seen from United States
seen from South Korea
seen from United States

seen from United States

seen from United States

seen from Singapore

seen from United States

seen from Türkiye
seen from South Korea

seen from United States
seen from United States
Been doing some #optimization on my site. Seems to be working! • • • • #wprocket #domainsharding #minification #prefetch #maxcdn #cloudflare #imagecompression
On Domain sharding
The good
A few years ago around the time of IE 6, most browsers allowed only 2 parallel requests to a single domain. This was a problem for sites that stored multiple JS, CSS and image files on a single domain (See [1]). Along came domain sharding to the rescue. Now, you could use multiple domains while still storing everything in the same place.
The bad
However, using multiple domains means a new connection has to be made to each of these domains, which increases latency. Also, all modern browsers support 6 connections per domain. So, you shouldn't be using too many shards. From [2] and [3], 2 seems to be an optimum number.
Additionally, too many shards tends to increase network congestion in the browser as described in [4]
The ugly
Recent developments have further increased the costs of these new connections. They are:
Mobile traffic: Making an extra connection from a cellphone is very expensive and adds significantly to the latency of the page [5]
SPDY: SPDY works best when several components are loaded over a single connection. Sharding negates the advantages of SPDY [6]
SSL: SSL connections are very expensive due to the handshake and Certificate verification.
In summary, domain sharding is still useful, but it cannot be used as a big hammer. 2 domains seems to be ideal, but do test with your page and if possible, a bucket of real-world users.
Links:
[1] Sharding Dominant Domains by Steve Souders [2] Reducing Domain Sharding by Jonathan Klein [3] Domain Sharding revisited by Steve Souders [4] Network Congestion and Web Browsing by William Chan [5] Why Domain Sharding is Bad News for Mobile Performance and Users by Peter McLachlan [6] SPDY best practices by Chromium dev team