How does a CDN work?

Last update: 20170624

Last Friday I was asked “how does a CDN work?” The first time I was asked the same question was year 1999. I acquired a lot of CDN knowledge and experience since I join the industry in 2012. CDN is not yet an everyday business in Asia nowadays. I want to help. An one page brief explanation. Hope you like it.

What is a CDN?

A Content Delivery Network (CDN) is a collection of web servers distributed among multiple locations to deliver content to users more efficiently.[1]

What is the job to be done by CDN?

To send web content to enduser faster. How? By moving data close to the endusers to reduce round trips and network.

Ilya Grigorik, web performance engineer at Google, says [2]:

  • Latency, not bandwidth, is the performance bottleneck for most websites.
  • Four major latency types: propagation delay, transmission delay, process delay, queuing delay
  • To improve performance of our applications… we need to reduce round trips, move the data closer to the client.


Centralized Server vs CDN [3]

How does a CDN work?

In essence, CDN puts your content in many places at once, providing superior coverage to your users. For example, when someone in London accesses your US-hosted website, it is done through a local UK CDN server. This is much quicker than having the visitor’s requests, and your responses, travel the full width of the Atlantic and back.[4]

How??

By connecting users who request your website content to CDN, instead of connecting directly to your web server.

Using traditional centralized server model, a website, say www .abc.com, will usually have a “A Record” in the DNS configuration (of abc.com) to inform people to connect to the web server with the specific IP address, say 1.1.1.1. We call this Customer Origin. When a user John in Beijing browses www .abc.com the following (behind the scene) steps will happen:

  1. John’s computer will ask the its local DNS resolver to figure out the IP address of www .abc.com
  2. the resolver will then ask the root DNS server what is the authoritative DNS server of abc.com
  3. The resolver will then ask the authoritative DNS sever of abc.com what is the IP address of www .abc.com and will get the answer of 1.1.1.1.
  4. John’s computer will then connect to 1.1.1.1 to get the web content of www .abc.com

With CDN, www .abc.com will have a “CNAME Record” in the DNS configuration to inform people to connect to the server with the specific hostname, say abc.customer.cdn.com provided by the CDN provider. When John browses the website www .abc.com, we will have the same first two steps above-mentioned, but subsequent steps will become:

  1. The resolver will then ask the authoritative DNS server of abc.com what is the IP address of www .abc.com and will get the answer of abc.customer.cdn.com
  2. The resolver will then ask the authoritative DNS server of cdn.com what is the IP address of abc.customer.cdn.com. The authorization DNS server of cdn.com will, based on the IP address of John’s local DNS resolver and the CDN provider’s routing algorithm, provide the answer, say 2.2.2.2, which is the IP address of the CDN cache server located in/near Beijing and is the best machine to deliver the content of www .abc.com to John
  3. John’s computer will then connect to 2.2.2.2 to retrieve the web content of www .abc.com

Say there is another user Mary in Singapore going to browse www .abc.com, we will have the similar four steps, but the CDN provider will use, say 3.3.3.3, which is the IP address of the CDN cache server located in/near Singapore which can serve Mary most efficiently.

Do I need to upload my website content to CDN?

Not necessary. In most cases, CDN will on-demand fetch content from the Customer Origin.

When the CDN cache serve receives the HTTP GET request of www .abc.com from an enduser, the cache server will check if the requested content of www .abc.com is already stored in its storage:

  • If yes, then the cache server will send the content stored on it to the enduser. We call this “Cache Hit”
  • If no, then the cache server will fetch the content from the Customer Origin, then store it and send it to the enduser. We call the situation of missed content “Cache Miss”, and the process of fetching content from Customer Origin “Cache Fill”. CDN will Cache Fill when it needs to update the stored content.

The higher the Cache Hit rate, the faster the content delivery. High Cache Hit rate better utilizes CDN and reduces Customer Origin loading.

How long will the CDN keep my web content?

CDN provider will usually honor the Cache-Control header setting in Customer Origin. During the Cache Fill process, the CDN cache server will cache both the web content and the HTTP header information, including the Cache-Control header attributes. CDN provider will keep the content according to the Cache-Control setting or based on the customer CDN configuration.

What else?

CDN nowadays offers more features and services. Below are the key benefits of using CDN:

  • Faster delivery of both cacheable and non-cacheable content
  • Higher availability by leveraging CDN’s global footprint and scale.
  • More secure by shielding the Customer Origin from public access.
  • Reduce the expense on Customer Origin resources (computer and connectivity)

That’s all.

Reference:

  1. High Performance Web Sites, Steve Souders
  2. High Performance Browser Networking, Ilya Grigorik
  3. CDN, Wikipedia
  4. Essential Guide to CDN, Incapsula
  5. Cache-Control header, Mozilla.org

Notes

I prepare this blogpost on the new iPad Pro 10.5″ with Smart Keyboard. It is GREAT. Looking forward to iOS 11!


ASUS Zenfone 3 Review – an iPhone user perspective on Android 7.0

Published: 20170527

Truth be told, ASUS Zenfone 3 (model number: ZE520KL) is not new. It was launched almost one year ago in July 2016. There was many good product reviews. My review is a bit different, I am focusing on how it works differently from Apple iPhone.

I need an Android phone to work with my customers. I want to learn more about Android as well. It will be nice to have a second phone when I travel aboard, using domestic SIM card to make low cost local phone calls and to use it as a hotspot. It is not my main smartphone but a secondary device for testing and traveling.
My key requirements are:

  • a device which is running the latest Android 7.0 Nougat
  • the hardware is good/fast enough for 2017 and 2018
  • small size, light-weight
  • good battery life
  • good customer reviews
  • costs about US$200

It is challenging to find a device meeting all six requirements! Luckily I found the ASUS Zenfone 3 ZE520KL. Below are its key hardware specifications:

  • CPU: Qualcomm Snapdragon 625
  • RAM: 3GB
  • Storage: 32GB (8GB reserved for OS)
  • Display: 5.2″ Super IPS, 1080×1920 pixels (424 ppi)
  • Dimension: 146.9 x 74 x 7.7 mm
  • Weight: 144g
  • Battery: 2650mAh

Even though it is almost an one-year old device, it is still one of the top ten Best Selling smartphones listed at popular Taiwan website sogi.com.tw! Its list price is about USD220 (TWD6641)!

After using the ASUS Zenfone 3  ZE520KL on a daily basis for more than two months, I can say I am very happy with it:

  • It is fast, but not as fast as iPhone 7 Plus (not as expensive and heavy too)
  • comfortable to use it with a single hand
  • easy to carry in pocket
  • the battery life is good! Can work the whole day (8am-10pm) on a single full charge. Can usually function as a hotspot for 10hrs!
  • The fingerprint sensor is fast! (But I find it is more user-friendly to have the senor on the front side. The iPhone fingerprint implementation is better)
  • It supports dual SIM cards and hence I can put my two most frequently used overseas SIM cards in it.

The two minor drawbacks I find are the slow camera (comparing to iPhone) and the necessary evil USB Type-C interface (I have to buy some more charging cable…).

I find Nougat is very close to the performance/experience/stability of iOS 10.3. Nougat can do somethings which iOS cannot. Multi-window View is useful when you want to use two apps simultaneously on your phone. Quick Settings, the customizable version of iOS Control Center, reduces the friction to do frequent tasks.  A few other mentionable unique Android features:

  1. Google Assistant. Its voice recognition is much better than Siri! I don’t speak to my smartphone very often, but the Google Assistant “please tell me my day” is very useful in the morning.
  2. Android provides user more network visibility. The app WiFi Analyzer helps me to figure the WiFi signal strength in my home. As we use more and more “smart” home appliances (such as TV, iRobot and smartplug), we need better WiFi coverage across the home. WiFi Analyzer helps me to put the Wifi repeater at the right place. (We move from a single powerful router to a Wifi network system like Eero. Apple Airport products are not good enough.)The app Internet Speed Meter Lite shows at the toolbar how fast the device is retrieving data from the Internet. 
  3. Android provides user more network manageability. The app WiFi Prioritizer can monitor different network connectivity performance (WiFi vs WiFI, WiFI vs LTE, etc) and will use dynamically the more reliable and faster network. No more unusable WiFi connection! Android also allows to share the smartphone WiFi connection with laptop via USB tethering!
  4. Automation. The app MacroDroid execute behavior (such as change device configuration, launch an app, etc.) based on trigger (such as time, location, power charging status). Below is the my macro to use radio as morning alarm:

Cool?

One more thing: there are not many good accessories purpose-built for Android smartphone. I find one – Lamicall iPhone Stand T1. The stand is adjustable, it works great with ASUS Zenfone 3, especially if you want to charge it and use it in portrait mode at the same time.


I am sorry, the stand is designed for iPhone:P


Apple Watch Review – two year after

Published: 20170507

Time flies. Thanks.

I was lucky to get the Apple Watch Series 0 on the launch day two years ago. One major change after wearing it is now I run more and regularly. Several 5km runs per week. I am a healthier person now too.

Activity level indicators remind me to move or exercise more. They draw my attention. They are the triggers. 

Habit = trigger, behavior, reward

The most challenging job to run is to get out of the door before it was too late in the day. Will it rain? How many days from my last run? To see the sunset when running along the harbourfront? The Activity, Weather Conditions, RunKeeper, Sunrise / Sunset, Pedometer++ complications all help!

Tsukudani Yanagibashi Komatsuya at 1 Chome-2-1 Yanagibashi, Taitō-ku, Tōkyō-to 111-0052, Japan

It is great to take photos if you see beautiful scene or interesting thing when you are running, isn’t it? However it is not very easy to get the iPhone out of the armband in general. With iPhone 7 IP76 water resistance, I don’t have to put it inside any armband to protect it from rain /splash. I can carry iPhone 7 outside and let it more accessible. Quad Lock Run Kit helps me to do so. It just takes a second or two to detach/attach your iPhone to the armband. And it changes things!


So here my running gears:
-Airpods
-iPhone 7S Plus
-Quad Lock Run Kit
-ASICS Tiger GT-2000 running shoes

My Apple Watch Series 0 is 2-year-old and it works great (Notes a). If I buy a new one, below is wish list for my next Apple Watch:

1.three-day battery life, and I don’t have to carry the charging cable during short trip
2.built-in thermometer to measure body temperature, good info when running
3.Watch OS can launch app automatically/programmatically when it detach some motion/behavior patterns
4.Watch app which can measure sleep pattern/quality automatically (Notes b)
5.more useful complications

Gadget is very powerful computationally today. It will be great if it can be programmed to do things automatically and unattended. Let’s talk more next time.

Notes:

a.My sister told me recently that her Nintendo Game & Watch Octopus handheld was still working! It is 35-year-old!
b.Pillow tracks sleeping using Apple Watch
c.A.D. Bible Continues is on air at goodtv.tv/ch1/ every Sat 11pm Taipei Time. Chinese subtitle is available.

Thank you.


I left my iPad on a JAL flight

Published: 20170325
I left my iPad on JAL flight when I travelled to Japan recently.
“I left my iPad on JAL flight” I googled the phrase to look for ways to get back my iPad. I didn’t think my situation was radically uncommon. Luckily I found some relevant JAL FAQ page. My friend helped me to phone the JAL Henada Airport hotline the next day morning, they questioned us for details. They did find my iPad and verified I was the owner! We went to the airport in the afternoon and collected my precious iPad! Thank JAL!

Regarding iPad, one common complaint from the Apple community is the lack of software advancement. iOS cannot empower iPad more useful that iPhone! User cannot make the best use of the bigger screen! For example, one cannot use Flipboard (to find stuff) and Amazon (to shop) at the same time in landscape mode. Many popular apps do not support Split View on iPad.

As Android matures and hardware improves, Android devices can do somethings better than iPad and iPhone! Below is a multi-window session on ASUS Zenfone 3 5.2″. This smartphone is smaller and less powerful when compare to recent iPads but it does a better multi-window job!

By the way, I find Flipboard works better on Android. The Android version will usually return to the last article I was reading when I resume using Flipboard, while the iOS version will almost restart every time. In order to completely read an article if you switch between Flipboard and other apps frequently, you’re better using the Flipboard Read Later feature or Liking the article to remark it. Both requires additional steps.

Google Translate in any app is another useful and convenient feature. Use the Amazon app again example, as shown in the left-hand-side of the picture below, select the text and then tap the Translate option. Right-hand-side shows the translation inside the Amazon app. 

iOS does not provide similar feature. However, the powerful Workflow does! Translate Selection in Conrad’s collection can do translation in any app supporting App Extension.

Hope Apple’s acquisition of Workflow will make iOS more powerful soon!


Drive Thru History: The Gospels

Published: 20170110
Last update: 20170527

It is a good news!

If you want to know more about Jesus Christ then Drive Thru History: The Gospels is something for you.

What is Drive Thru History: The Gospel?
A TV program series with 18 action-packed episodes delve into the history, archaeology, geography, and art surrounding the birth, ministry, death, and resurrection of Jesus. Like you’ve come to expect from Drive Thru History®, these shows are fun, adventurous, and family-friendly. However, we think there is no better educational coverage of the Gospels available today! As a bonus, Dave takes you and your family on a unique driving tour of Israel to experience the actual places where Jesus traveled and taught.
[Source: drivethruhistory.com]

Each episode lasts about 27 minutes. The whole series is less than 9 hours. It is a great show. Thanks Dave.

I learnt about this TV program series from a friend. It is one of the Drive Thru History with Dave Stotts series produced by ColderWater Media. It maybe available on TV channel in your region. The series is also available in DVDs at Amazon.com.

You can watch it by browsing the Trinity Broadcasting Network website at www.itbn.org. The series can be found by clicking Program and then Educational, or by searching Drive Thru History. TBN uses CDN to stream the videos and the quality is good. Thanks TBN.

itbn-org-1

Please find below the list of the 18 episodes:

Episode 1: The Historical Landscape
Episode 2: The Announcements
Episode 3: Jesus is Born
Episode 4: Jesus Grows Up
Episode 5: Jesus Starts His Ministry
Episode 6: Jesus Returns to Galilee
Episode 7: Jesus Begins His Miracles
Episode 8: Jesus Teaches with Authority
Episode 9: The Sermon on the Mount
Episode 10: Jesus Travels the Sea of Galilee
Episode 11: Jesus Travels North
Episode 12: A Final Trip to Jerusalem
Episode 13: Jesus Arrives in Jerusalem
Episode 14: The Last Supper
Episode 15: The Trial of Jesus
Episode 16: The Crucifixion of Jesus
Episode 17: The Resurrection of Jesus
Episode 18: Who is Jesus?

Some quick notes:
a.iPhone/iPad: use Safari, click the video and it plays! English subtitle is available.
b.Android device: use Firefox or Chrome, click the video and then it will ask you to install Hook which is a video player for Android developed by Ooyala. English subtitle is available.

screenshot_2017-01-10-22-58-30

c.MacBook: use Safari, click the video and it plays. If you hear strange audio like many people talking in different languages, then you can stop the strange audio by pausing the videos in all the eleven live channels!

itbn-org-3

And he asked them, “But who do you say that I am?” Peter answered him, “You are the Christ.” Mark 8:29

Thanks God!


Transcend JetDrive Go 500 Review

My two use cases for a Flash Drive with BOTH Apple Lightning and USB Type-A ports:
-to transfer file from iPhone to notebook or desktop computers (esp. Windows machines)
-to copy videos/photos from iPhone and to view them on iPad

I travelled to Jiuzhaigou recently. I bought my iPhone and iPad. I believed my iPhone could meet almost my needs but iPad would do a better job for viewing photos. A lot of photos.

img_0599

Arrow Bamboo Lake, Jiuzhaigou, Sichuan, China

img_0750

Five Flower Lake, Jiuzhaigou, Sichuan, China

img_0877

Reed Lake, Jiuzhaigou, Sichuan, China

My iPhone could meet almost all my needs. However I had to print out some travel document on physical paper during the trip. I expected there were Windows PCs with printers for guest use at the hotels. I was not sure the PCs could access cloud storage like Dropbox. I needed a means to easily transfer a pdf document made on my iPhone to the hotel PC – a flash drive with both Apple Lightning and USB TYPE-A interfaces.

I did bought this kind of flash drive two years ago. The objective was to offload photo storage usage from iPhone. It did not work since last year! iOS 9 or later devices cannot detect the drive! It was an expensive gadget and I expected it works for two or more years! It was a unpleasant experience. Dual-port flash drive was a new gadget category at that time and there were not many options. This category is more mature now and we have more choices. My current selection criteria are
1.Apple MFI certified
2.supports USB 3.0
3.physical design with extended lightning connector (for easy plug-in when there is iPhone case)
4.a good iOS app which supports common document formats (pdf, docx, pptx and xlsx, etc.) as well as photo and video. Because of iOS restriction, we need a dedicated app to use the physical flash drive. Lightning flash drive is a two-component product!
5.supports both iPhone and iPad
6.made by company with sound reputation of reliable products
7.good customer reviews/feedbacks

These are my first round selections:
SanDisk iXpand Flash Drive
Lexar JumpDrive C20i
Ravpower iPhone Lightning Flash Drive USB 3.0
Transcend JetDrive Go 500

Based user reviews, SanDisk iXpand and Lexar JumpDrive do not support formats other than photo and video! Both Lexar and Ravpower can be used as charging cables which are useful! However they are a little bit bulky. I wonder if the rubber portions are durable.

Finally I bought a 32GB JetDrive Go 500. It meets all my criteria! It is small, light and tough. The case is made of zinc alloy. There is no moving part. Very handy to carry.

transcend-jetdrive-go-vs-airpod

Transcend JetDrive Go 500 is small than AirPod and one gram heavier.

I have been using it for almost a month. It is fast and reliable. Below is a highlight of its spec:
– Ports: one lightning and one USB 3.1 Gen 1 Type A
– Maximum data transfer rate: lightning at 20MB/s and USB at 130MB/s
– Dimension: 36.55mm x 14.3mm x 9.01mm
– Weight: 5g
– Warranty: 2-year
– iOS app: JetDrive Go. The app will prompt you asking for your permission to launch the app to access the device when you plug it in your iPhone or iPad.

There is an informative review on appleapple.top. Below is another good review, by Tony Mauro Ruiz, on YouTube:

I wish the iOS app will support AirPlay soon.

I will recommend this device to if you have use cases similar to mine. Transcend is a well known Taiwan manufacturer, found in 1988, focusing computer memory and storage products. Transcend products in general are good in terms of performance, industrial design, software, quality control and customer service. Its products work reliably for years! Transcend JetDrive Lite, launched in 2014, is a very popular storage solution for MacBook Air and MacBook Pro (mid-2016 and before).

I hope you find this review useful.


Apple AirPods Review – day 5

Thank Apple again! Many of us get our long-awaited AirPods this week! It is said that many receive early deliveries of their online orders too. Cheers!

General feedbacks about AirPods are very positive. Fortune says AirPods are Perfect!  Forbes believes AirPods is a bigger business than Apple Watch. They maybe the most physically resilient Apple product too!

After using it for five days, I observe a few things and have some comments:
1.AirPods does not support multi-point (connecting the headset to two devices simultaneously) which is a common feature of modern Bluetooth headphones. (One iPhone is better than many non-iPhones. Then why we need this? Because it is strange to speak to the Apple Watch when the digital crown is pressed while AirPods are in the ears.)

2.When remove the AirPods from the case, AirPods will by default try connecting to the last connected device. It requires manual connection on another device if your want to switch the AirPods to the that device.

3.If you switch on another Bluetooth headset/speaker then your iPhone will connect to it and switch the audio source to it.

4.By default double-tap triggers Siri. It can be changed to Play/Pause or Off at iOS Settings > Bluetooth. It is not configurable in Sierra and hence always Siri. Different iOS devices can have different configurations. Say double-tap to trigger Play/Pause when AirPods connect to iPhone, and to trigger Siri when AirPods connect to iPad.

5.AirPods works with non-Apple devices such as Android tablets and Nokia phones. Double-tap can trigger Play/Pause only. Take an AirPod out from ear will pause audio.

6.AirPods connectivity is very very good! They work even if the iPhone is a  different room ten of meter away!

7.AirPods stay firm and comfortable in ears. At least my ears. It is fine to wear it/them the whole day, no matter you are sitting, walking, running, typing, eating or sleeping! It is always on. It is private. We can expect more applications using audio communication and interaction. And yes, it changes behavior!

My wish list items for the next generation:

-Apple Watch complication for Now Playing, to allow one click control of sound volume via Apple Watch. This requires no hardware update and should be easy:)

customisable equaliser Update: from iPhone User Guide: Go to Settings > Music > EQ. EQ settings generally apply only to music played from the Music app, but they affect all sound output. Thank AppleInsider.

body temperature measurement

-optional noise cancellation or reduction

-a physical hole or something on the case. It will be convenient if the case can be connected to keychain. One drawback is will sketch the case surface…

Merry Christmas! Happy Holiday! And I want to share this song with you – Hallelujah by Killard House Special School choir: