Implementing CDN for Websites

CDN, short for Content Delivery Network or Content Distribution Network, is a system of computers containing copies of data placed at various nodes of a network.

When properly designed and implemented, a CDN can improve access to the data it caches by increasing access bandwidth and redundancy and reducing access latency. Data content types often cached in CDNs include web objects (text, graphics, URLs and scripts), downloadable objects (media files, software, documents), applications, live streaming media, and database queries.

If you currently own a website with good traffic, and you think you can give more pleasure to your audience by giving them more speed in page load times, using CDN can be an option. CDN nodes are usually deployed in multiple locations, often over multiple backbones. These nodes cooperate with each other to satisfy requests for content by end users, transparently moving content to optimize the delivery process. These can significantly reduce bandwidth costs, improve end-user performance (reducing page load times and improving user experience), or increase global availability of content.

However, if your site is not rich in media contents or only target visitors on your local area, and doesn't make a thousand hits a day on the traffic, using a CDN is not a good option for a speed increase because it may take more time to load that it was before. it is also not good for your ROI. If you have a website which serve rich multimedia contents targeted for global audience, you should consider starting on CDN from day one.

When will the CND be needed: When these factors collide:

  • Tests taken show that the majority of users will see a speed improvement.
  • When it is financially viable for your site.

What to put on the CDN? Everything that doesn't change, or static. That means your database and server-side code stays on your original site but all the others like CSS, JavaScripts, images, videos and other media contents, go on the CDN. The CDN should also cache copies of your dynamic pages though how aggressive that cache should be depends on your site. Many CDN systems will automatically grab what contents they need without you doing to much.

Google and Bing consider loading time as one minor ranking factor. This is the reason google launched page speed service recently. It'll not boost your ranking but if your site loads slow due to media content then it'll benefit from CDN and search engines will also push more weight to faster site.

The Benefits

If your website meet the factors to use a CDN, below are some of the benefits explained:

1. Different domains

Browsers limit the number of concurrent connections (file downloads) to a single domain. Most permit four active connections so the fifth download is blocked until one of the previous files has been fully retrieved. You can often see this limit in action when downloading many large files from the same site.

CDN files are hosted on a different domain. In effect, a single CDN permits the browser to download another four files at the same time.

2. Files may be pre-cached

jQuery is ubiquitous on the web. There’s a high probability that someone visiting your pages has already visited a site using the Google CDN. Therefore, the file has already been cached by your browser and won’t need to be downloaded again.

3. Boosts performance and saves money

CDN can distribute the load, save bandwidth, boost performance and reduce your existing hosting costs — often for free.

4. High-capacity infrastructures

You may have great hosting but doesn’t have the capacity or scalability offered by Google, Microsoft or Yahoo!. The better CDNs offer higher availability, lower network latency and lower packet loss.

5. Distributed data centers

If your main web server is based in the United States, users from Europe or Asia must make a number of trans-continental electronic hops when they access your files. Many CDNs provide localized data centers which are closer to the user and result in faster download speeds.

6. Built-in version control

It’s usually possible to link to a specific version of a CSS file or JavaScript library. You can often request the latest version if required.

7. Usage analytics

Many commercial CDNs provide file usage reports since they generally charge per byte. Those reports can supplement your own website analytics and, in some cases, may offer a better impression of video views and downloads.