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!

CDN video: HLS performance measurement

HTTP Live Streaming

The recent Devoncroft’s 2013 Big Broadcast Survey (BBS) shows multi-platform content delivery is the most important trend considered by the broadcast industry. It is not a surprising news when we review how much time we spend viewing videos on non-TV devices.

Video streaming on iOS devices is supported by HLS (HTTP Live Streaming). HLS democratises video streaming: everyone can now easily stream adaptive bit-rate videos to iOS devices by using a low cost HTTP servers.

In comparison, it is much more challenging to stream videos to other mobile platforms. Here is a good reference article from LongTail: The Pain of Live Streaming on Android

We can easily stream videos to iOS devices. How do we measure the video performance? How do we validate HLS videos delivered from CDN are much better than those from customer origin? Which adaptive bit-rate video stream in my demo page – HLS Performance Measurement – provides better experience?

HLS Performance Measurement by PocketProbe

Rather than subjective measurement by our eyes (目測法), PocketProbe Free from Bridge Technologies provides an objective measurement of HLS video experience.


I did some PocketProbe tests around 12:30pm 20130626 HKT. Left is the test result of stream from customer origin (CO) and right is from CDN respectively.

PocketProbe test results

1.CDN stream was delivered more frequently at higher speed than the CO stream.
2.CDN stream was retrieved much faster than CO stream.
3.CDN stream was delivered constantly at the highest bit-rate while CO stream switched to lower bit-rates during the delivery.

We can SEE the CDN stream picture resolution and quality are better too.

iOS a great platform for video streaming. PocketProbe is a cool app for video streaming performance measurement.

Easy. Low cost.

CDN Load Balancing by Cedexis Openmix

Why multi-CDN?

Different CDNs have different network footprints. A CDN performs differently at different times due to different traffic patterns and loadings. One CDN may perform better than others for a specific geo region at a specific point of time.

Say your website is using two CDNs: provider A and E. Sometime A performs better than E. Sometime E performs better than A. Your website performs the best if your website is always using the best of them at any given time. Doing so you need two things
-a measurement system monitoring performances of both A and E
-an intelligent DNS which can change of content URL to CDN URL of either A or E based on their performances

EdgeCast and another CDN

In this demo, I use Cedexis Openmix to load balance two CDN services for four big images on this original webpage. About 60% of the page size is from these four images.

I use EdgeCast and another CDN to show the Cedexix Openmix CDN load balancing feature. There are some CDNs provide free services – Incapsula, CloudFlare, CDN.NET – at the end I create a 14-day free account at CDN77 because they are easy to use, do not require me to migrate my domain to their name servers and do not ask my credit card information.

I set up both EdgeCast and CDN77 to cache the contents from, the hostname of the four images on the original webpage, and the CDN URL hostnames are and respectively. I add two CNAMEs in my domain – and – to hide the CDN URLs.

To use a single CDN is simple: to change the image origin URLs to either one of the aforementioned CNAME URLs.
Using EdgeCast:
Using CDN77:

Cedexis Openmix

In order to dynamically load balance among these two CDNs by Cedexis Openmix, there are a few steps:
1.under Platforms: to add both EdgeCast and CDN77 to Platforms. Cedexis Openmix will load balance based on the performance of the Platforms entries.


2.under Openmix: to add a new DNS Application. I select Optimal Round Trip Time in the Application Type. I put in Fallback CNAME. Time to Live (of the Cedexis CNAME assigned later) is 20 seconds. In destination platform, I add both platforms defined in step (1): EdgeCast with CNAME and CDN77 with CNAME of Cedexis then assigns a Cedexis CNAME for this DNS application:



3.under Openmix: once I publish this DNS application, every 20 seconds Cedexis will change the CNAME of to either or if at that moment the best performing CDN is EdgeCast or CDN77 respectively.

4.EdgeCast and CDN77: to add as a CDN CNAME. Doing so when a HTTP request with Host header is received, EdgeCast will point it to the CDN URL CDN77 will point to the CDN URL

5.the final step: in the original webpage, to change to The result webpage is

To summarise: Cedexis update its DNS record so that is (CNAME to if EdgeCast performs better, OR (CNAME to if CDN77 performs better

The actual result? Between 12:00pm and 1:00pm 2013-06-17 Hong Kong Time, there were 847 DNS queries of, Cedexis Openmix resolved 62% queries to EdgeCast.



I used Catchpoint to do synthetic HTTP GET test to measure webpage response time from Asia, North America and Europe. Here are the test results between 7pm 2013-06-17 and 7pm 2013-06-18 Hong Kong Time:
Using EdgeCast only: 2466ms, 24768 tests
Using CDN77 only: 2528ms, 24768 tests
Load balance between EdgeCast and CDN77: 2493ms, 24768 tests. Cedexis Openmix routed 68% of traffic to EdgeCast.


With similar idea, I can use Openmix to load balance CDN and the original server. I need to add a custom Platform in Cedexis to measure the origin server. Here is a example of a 50-50 Round Robin load balancing between EdgeCast and the original server, the one listed on my demo site.

EdgeCast Live Video Streaming

CDN video: Live Streaming

TV Live video streaming, I finally cracked it!

Video delivery is a big use case of CDN. Especially for live video, because for live video a huge number, abnormal from the normal level, of viewers are expected to watch it at the SAME time. It is not likely that a typical company will over-provision its own system capacity to handle this kind of abnormal and non-frequent high traffic volume, unless it is a CDN.

My partners ask me a lot of questions about EdgeCast video streaming solution for live event. I tested/demonstrated it many times, but I did not set up a demo page for it. Why? It is because I didn’t have good live video source! What I have is a MacBook Air, iPhone and iPad. Only MBA can take a video encoder role. Capturing myself by the MBA FaceTime camera and streaming “I’m typing on my notebook” in live is not something I find very interesting and attractive. It is like a still picture rather than live video!

A partner asked me again about live streaming solution last week. It is too costly to explain to each partner one-by-one and set up an ad-hoc demo on-demand every time. It is much more effective and efficient to support my partners if there is a demo page. I always think this way. And finally I make it this time.

What about the live video source?

Well, every tomorrow is a better day. I found last weekend a new, great and free iOS app – OS Broadcaster by Olobon Soft – a video and audio encoder. It turns the iDevice into a mobile video encoder!

I can send live video, via RTMP, from OS Broadcaster to EdgeCast publishing points and then EdgeCast streaming services send the video instantaneously to users all over the world. I find myself become a (potential) TV channel which can provide live videos to thousand of thousand of people! I can share, anywhere and anytime, with the audiences interesting things around me, esp. those in HK, in the most entertaining format – video!

I found yesterday another great and free software – CamTwist for Mac – which can capturing things on desktop and become a video source for Adobe Media Live Encoder. With these tools I can now live stream anything on my screen (such as youtube content, TED talks or my own videos) through EdgeCast CDN to people anywhere who have PCs via RTMP and iDevices via HLS.

How to Stream Your Mac Desktop Live is a great tutorial on youtube showing how to use CamTwist as well as other great tools!

To see is to believe.

Please try yourself: 16th demo – CDN video: Live Streaming

The Journey is the Reward.

Catchpoint Domain Override

Catchpoint Domain Override

In my previous blog A/B testing on CDN improvement we shared how to use A/B test to demonstrate the webpage performance brought by CDN. No matter what tool we used, it required customers to change their webpages to insert some JavaScript codes.

What if our goal is to minimize customer changes during the demonstration/proof of concept stage? I am going to demonstrate Catchpoint performance measurement service to achieve this goal.

Well, let’s take one step further to avoid ANY customer changes!

Catchpoint is one of the popular performance monitoring services. Many enterprises and cloud service providers buy Catchpoint solutions to monitor their websites and Internet services.

One cool Catchpoint feature is domain sharding/override. When it does page load test, Catchpoint can be configured to change the hostnames, say from A to B, in the HTML codes. By doing so Catchpoint will GET the HTTP objects from host B instead of A.

Let’s use this original webpage as an example. 82% of the page size comes from four images. I am going to do an A/B test on it. Original webpage is Test A. In Test B the four images will be delivered from EdgeCast CDN rather than the customer origin server in Singapore. This simulates actual CDN deployment on this webpage.

Step 1: I set up EdgeCast CDN services to cache the four images from the customer origin.

Step 2: I set up Catchpoint to test the original webpage from several Asia countries. This is Test A.

Step 3: I configure another test to test the original webpage again and use the domain override feature to change the original hostname (of the host of the four images) to the EdgeCast CNAME I set up in Step 1. This is Test B.

Step 4: This step is not a must-have and I use it for Control only. I add a new webpage in the customer origin. The new webpage is the same as the original webpage but in the HTML code I change the hostname of the four images to the EdgeCast CNAME I set up in Step 1. This is Test C.

I run the tests for 24 hours. Online reports: Test A vs B, Test A vs B vs C.

Below screen capture shows the page load time, response time and availability test results of Test A and B in the last two days. It shows Test B performed much better than Test A, Average Webpage Responses are 3962ms vs 5131ms, a 23% reduction. We did the test WITHOUT any customer changes!

Test A vs B

Test A vs B

You may wonder if Test B is a good simulation. Below screen capture shows the test results of all Test A, B and C. Test B and C results are similar (Average Webpage Responses are 3959ms & 4089ms respectively). I find the Catchpoint domain override feature is a good simulation of CDN deployment.

Test A vs B vs C

Test A vs B vs C

Google search “CDN Hong Kong”

CDN Hong Kong

Last week I chatted with different friends in different occasions about how to reach potential customers online more effectively. One critical question is what potential customers will do when they are looking for something?


Most of the time Google. Sometimes Yahoo or Bing. Right?

So, the question becomes “can your potential customers find your information when they Google search?”

SEO Made Simple is a great book about Search Engine Optimization written by Michael H. Fleischner.

“The ideas, steps and strategies shared in this book is easy to understand and beginners in SEO can easily apply them to their websites.”

Below are some of the key optimizations:
– include your keyword phases in the meta tag
– proper meta tags include title tag, description tag, keywords tag and robots tag
– chose your URLs carefully
– design your webpages to force Google to read on-page content first
– include keyword phases in header tags
– italicize, bold and underline your keyword phase within content
– keyword development
– have a large number of quality sites linking to your webpages

How easy? Very easy! I use both SEO ideas mentioned in the book and EdgeCast CDN services in my blog and my CDN demo site.

In my blog More visitors and higher conversion rates? SEO + FEO, I shared how important is page load time to websites and how FEO and CDN would improve page load time. What every marketer needs to know about page speed’s effect on pagerank is another great article about speed and Google search rankings.

Does it work? As of 16-Apr-2013, I am quite happy with the Google search results pointing to my blog and demo site, my blog or demo site are usually listed in first result page:

search terms
CDN demo 1 3
CDN demonstration 1 1
how to use EdgeCast 1 1
EdgeCast CDN 12 7
what is CDN EdgeCast 2 2
CDN video iPhone 2 2
CDN video access control 1 1
CDN control rules 1 1
accelerate small objects 1 1
flash video CDN 2 3
CDN A/B test 1 1
EdgeCast Edge Optimizer 1 1
EdgeCast Application Delivery Network (ADN) 1 1
mobile optimized Webpage EdgeCast 1 1
CDN Hong Kong 18
(1, update: 20130509)
(1, update: 20130509)
“CDN Hong Kong” 1 1
Synthetic Performance Measurement
(add: 20130501)
(update: 20130509)
(update: 20130509)
CDN Hotlinking Prevention
(add: 20130501)
(update: 20130509)
(update: 20130509)
EdgeCast live video streaming
(add: 20130509)
(update: 20130509)
(update: 20130509)

I am using the same techniques in this article too. Let’s see later what are the Google search rankings when people Google search “CDN Hong Kong“.

EdgeCast Application Delivery Network (ADN) improves dynamic content performance

EdgeCast Application Delivery Network

EdgeCast Application Delivery Network (ADN) improves web page performance by optimizing TCP/IP network paths & communications to reduce latency and increase speed of non-cacheable content.

Dynamic content cannot be practically/effectively cached because a dynamic asset previously generated by a web application would never be requested again. ADN finds other ways through which to speed up data delivery to clients. ADN is able to drastically reduce the amount of time that it takes to communicate with the origin server by optimizing the network path and through the use of both server efficiency and RFC-compliant protocol optimizations. This allows these dedicated servers to transmit dynamic data at a much faster rate than traditional Internet data routes.


EdgeCast ADN performs better than traditional Internet because
EdgeCast PoPs around the world are connected with each other with best selected routes at multi-hundred Gbps capacities
– TCP/IP connections between EdgeCast edge servers and ADN gateway servers are optimized by techniques such as TCP Fast Start, TCP Packet Sizing, Congestion Avoidance, Connection and Packet Multiplexing, etc.
– The closet EdgeCast ADN gateways will be selected to connect to customer origin to maximize transmission performance between customer origin and EdgeCast ADN
– The closet EdgeCast ADN edge servers, based on BGP Anycast technology, will be selected and connected to client to maximize transmission performance between client and EdgeCast ADN

Therefore by routing traffic through EdgeCast ADN rather than public Internet, customer origin can send dynamic content to client at higher speed!

To demonstrate EdgeCast ADN, I simulate dynamic content by adding the following codes in the .htaccess file under the directory
<FilesMatch “.(jpg|jpeg|png|html)$”>
Header set Cache-Control “max-age=0, private, no-cache, no-store”

The original page is
The ADN optimized page is

Random tests at Webpagetest show the ADN optimized page loads faster than the original page:
Webpagetest result of the original page
Webpagetest result of the ADN optimized page
Webpagetest visual comparison

Webpagetest Visual Comparison

We can see the Time to First Byte and Content Download of those objects delivered from EdgeCast ADN – the HTML code and the image edgecast-adn.jpg – are faster than that of the origin page.

Google Analytics Page Timings on 4-Apr-2013:
– Original page: 2.25sec average page load time
– ADN optimized page: 1.79sec average page load time

Please click the original page and ADN optimized page to see & feel the performance improvement yourself! Your engagement will help generating more RUM data too!

EdgeCast Edge Optimizer improves performance by modifying web pages based on Google PageSpeed

EdgeCast Edge Optimizer

How to speed up your web pages?
1.move/cache your content closer to your users to reduce TCP/IP latency and increase transmission speed
2.optimize TCP/IP network paths & communications to reduce latency and increase speed
3.modify web pages to decrease amount of data and number of assets

CDN is doing #1. More mature and advanced CDN provides #2 and #3 too. EdgeCast Application Delivery Network (ADN) and Edge Optimizer improve web page performance by the means of #2 and #3 respectively.

Dynamic content cannot be practically/effectively cached because a dynamic asset previously generated by a web application would never be requested again. ADN finds other ways through which to speed up data delivery to clients. ADN is able to drastically reduce the amount of time that it takes to communicate with the origin server by optimizing the network path and through the use of both server efficiency and RFC-compliant protocol optimizations. This allows these dedicated servers to transmit dynamic data at a much faster rate than traditional Internet data routes.


Edge Optimizer modifies the web pages being delivered to clients. The most common performance benefits that these modifications can achieve are to decrease the amount of data that needs to be transferred and the number of assets required to properly load your web page. In turn, this allows data delivery efficiency improvement without requiring modification to the original source code. The following illustration indicates how a website can be streamlined through Edge Optimizer.


Edge Optimizer modifies web pages based on Google PageSpeed. It modifies web pages with five sets of filters:
-HTML Rewriters: modifies HTML code to reduce bytes transferred and number of assets that need to be requested
-CSS Rewriters: modifies inline and referenced CSS
-JavaScript Rewriters: modifies inline and referenced JavaScript
-Image Rewriters: transform images and the HTML code used to reference them
-Cacheability: modifies HTML code to increase the cache policy assigned to referenced content

I use this simple original webpage to demonstrate how Edge Optimizer improves performance. First of all I run a Webpagetest to analyse the original webpage and to identify potential areas of improvement. Here is the Webpagetest result of the original webpage:

From the waterfall diagram I find a large portion of page load time is caused by a few images (items 4, 5, 9 and 12). I configure Edge Optimizer HTML Rewriters to remove comments from the HTML page and Image Rewriters to compress some images. EdgeCast GUI is very user-friendly and powerful and it takes me a few minutes to complete the configuration. This is the optimized webpage. Here is the Webpagetest result of the optimized webpage:

A quick comparison of the Webpagetest results:

Original Optimized Difference
Number of HTTP assets 21 21 nil
Total Page Size (KB) 865 313 -64%
Document Complete Time (sec) 5.559 1.763 -68%

68% reduction in document complete time!

From the Webpagetest result I identify four objects are optimized by and delivered from EdgeCast ADN:

  • HTML page is reduced from 6.2KB to 5.9KB (item 1)
  • image avatar.jpg is compressed from 34.8KB to 3.9K (item 3)
  • image happystreet.png is converted from a 662.5KB PNG to 141.7KB JPEG (item 4)
  • image 08487_footerMdotLogo.png is compressed from 3.1KB to 2.5KB (item 7)

Besides page size and load time improvements, the optimized webpage scores higher PageSpeed and YSlow grades than the original webpage according to GTmetrix.

Further improvement is possible. For examples:

  1. add more Edge Optimizer filters, such as Inline Images filter to reduce number of assets
  2. cache non-compressible images
  3. both (1) & (2)
Webpagetest Result (1) (2) (3)
Number of HTTP assets 19 21 19
Total Page Size (KB) 318 313 318
Document Complete Time (sec) 1.691 1.431 1.039
Document Complete Time vs Original -70% -74% -81%

EdgeCast Edge Optimizer is a great and quick solution to improve performance, especially for dynamic webpages which are not easy to modify manually.

A/B testing on CDN improvement

In web development and marketing, A/B testing is an experimental approach to web design which aims to identify changes to web pages that increase or maximize an outcome of interest. There is a great A/B testing article in Smashing Magazine.


In order to demonstrate how CDN can improve page load time, I would like to use an A/B testing with faster load time as the success metric. The 110KB Tokyo Skytree photo in version B is cached on EdgeCast CDN while the one in version A is not.

I need your engagement to collect more RUM (Real User Monitoring) data to make this exercise successful! Would you please help clicking the following links?

Which version do you find is faster?

A/B Testing Results

Thank you very much for your help clicking the above-mentioned links between 27th Feb and 5th Mar 2013! Let’s share the test results.

I used free RUM services from Google Analytics, StatusCake and Torbit to measure the page load times. All of them required to add javascript codes in the web pages to collect RUM data. Below were the average load times from Google and StatusCake between 28th Feb and 5th Mar.

Google Analytics:
A/B test – A: 1.89 seconds (20130320 update: 2.34sec)
A/B test – B: 1.79 seconds (20130320 update: 1.88sec)

Google Analytics

A/B test – A: 2.12 seconds (20130320 update: 2.38sec)
A/B test – B: 2.03 seconds (20130320 update: 2.05sec)


It showed the average page load time of version B – the one using EdgeCast CDN to cache a 100KB photo – was less than that of version A. This simple A/B testing showed EdgeCast CDN improved page load time.

I found both Google and StatusCake could not measure page load time from iOS devices. Possibly because iOS rendering engine did not support W3C navigation timing.

FYI, besides free RUM service, StatusCake also provides free synthetic performance monitoring.

StatusCake synthetic monitoring

Torbit free service did not provide RUM data of individual URL. That said, Torbit did provide great free Realtime RUM tool. It seemed that Torbit could collect data from iOS devices.

Torbit Realtime Monitoring

Joshua Bixby’s podcast; RUM vs Google Analytics

The last two days I found and listened to a great podcast series by Joshua Bixby, VP Application Acceleration at Radware. One podcast was a discussion between Joshua and Torbit CEO Josh Fraser about how performance has changed from a technical metric to a business metric, as well as RUM (Real User Measurement) vs Google Analytics.

As Josh pointed out in the podcast, “accurate measurement is the prerequisite of web site optimization.”

I think one of the challenges of CDN and site optimization adoption in Asia is that many companies do not have good visibilities of their websites. It is not due to lack of budget to buy tools, but the lack of understanding of how to properly manage web sites.

“If you can’t measure it, you can’t manage it!”

More customer education is needed to move the market crossing the chasm!

There are a lot of tools to measure different kind of site performances. Google Analytics is a great FREE tool to gain visibilities of how and by whom your website is used. Together with some iOS apps, you have your site usage info anytime and anyplace! Here is the screen capture of Analytiks about my following demo pages:

1.What is CDN – showing how CDN improve large objects delivery

2.CDN video: progressive download and HLS

3.CDN video: access control

4.EdgeCast can turn your H.264 videos into HLS on-demand streams

5.Control your CDN by Rules Engine

6.SSD storage-based cache server to further improve Small object delivery

7.EdgeCast supports flash-based video using RTMP delivery

8.EdgeCast HTTP Large platform speeds up software download


Cedexis Radar is a FREE RUM tool which helps you to understand how good is your website performance from the perspectives of real users around the world! Similar to Google Analytics, what you have to do is to add a few JavaScript lines in those webpages you what to measures. Here is the Cedexis Radar data of my above-mentioned demo pages:


With site usage, demographic and performance info, now you know IF you should better serve your users. The next question is HOW.