CDN and then Domain Sharding

[update 20160310: thank you for visiting my blog. Please note that demo webpages in this post are now working now. I will update them soon. ] says there are 86 resources and 7.6 hosts per web page on global average. However, for a typical website in Hong Kong there is a single dominant domain being used for downloading resources. It maybe because of easy content management – everything is under the same domain and relative paths are used in html codes. Another reason is the lack of understanding CDN and Domain Sharding.

There is a max number of concurrent connections to a single hostname for browser. For example, the numbers are 8 and 6 for IE 10 and Mobile Safari respectively according to Browserscope. This number limit the page load speed even if there is abundant available physical connectivity. Refer to Steve Souder’s Even Faster Web Sites, rule #9 Domain Sharding splits web content resources across multiple domains rather than a single domain. This technique allows more resources to be downloaded in parallel and hence reducing the overall page load time.

Should you use a lot of host on your web pages? Everything has its limit. Mobify did a test in 2012 and found that 2 hosts per mobile web page was the optimal number!

In my 21st demo, I compare web page with a single domain, with domain sharding and/or CDN applied:
A: origin web page delivered from customer origin in Singapore
B: the web page is delivered from CDN
C: the web page with domain sharding is delivered from CDN
D: the web page with domino sharding is delivered from customer origin in Singapore

All A, B, C and D are 150KB in size with 13 resources (including the HTML page). There is a single host in A. For D, resources split across two hosts, and which are both in Singapore. To set up B is simple, is pointing to CDN and CDN caches all resources from For C, resources split across two hosts, and, and is pointing to CDN and CDN caches resources from

Using webpagetest to load the pages from Dulles which is 18,256km from Singapore. The distance is about half of the 40,008km circumference of the Earth!

Test 1: A vs D: page load times of A and D are 1.669s and 1.549s.

Domain sharding improved page load time. Since the distance between web server and browser was huge, large transmission latency resulted in long load time. Transmission latency due to physical distance cannot be reduced by domain sharding.

Test 2: A vs B vs C: load times are 1.664s, 0.540s and 0.400s respectively.

It took just 32% of the load time of A to load B! Since content was delivered from EdgeCast CDN edge in Washington to Dulles, RTT was much smaller and transmission speed was much higher!
C was even faster since 12 objects were simultaneously download while for B only 6 objects were downloaded concurrently.

Test 3: C vs D: load times are 0.384s and 1.535s.
Domain sharing were used in both C and D. For C, distance and RTT between EdgeCast CDN edge and browser were both small, therefore times required for Initial Connection and Time To First Byte were small too!

1.use CDN first to improve website performance. Use CDN is the rule #2 suggested in Steve Souder’s first book High Performance Web Site. order to make Even Faster Web Sites, apply Domain Sharding after CDN!

One Comment on “CDN and then Domain Sharding”

  1. creare site says:

    That is really interesting, You’re an excessively professional blogger.

    I’ve joined your feed and stay up for in quest of more of your wonderful post.
    Additionally, I’ve shared your website in my social networks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.