Improve Website Performance Using a CDN (Content Delivery Network)

If you’re a local business targeting a local geographic area, it may not matter much. But, if many of your customers come from different parts of the world, you can improve website performance by using a CDN (Content Delivery Network). Basically, website assets like images and videos can be referenced in your code to come from a CDN instead of the same server hosting your web pages. If a user is viewing your website from the US, then the website’s assets will be downloaded from a fast server near the US. Similarly, is a user is viewing your website from Europe, then the website’s assets will be download from a fast server near Europe. Though CDNs used to be expensive, they’re cheap now. Amazon offers a cheap and easy-to-use CDN called CloudFront where you pay per use.  Here’s one way to set it up:

  1. Create an Amazon Web Services (AWS) account.
  2. Upload your assets (images, videos, etc) to Amazon S3 (storage)
  3. Create a distribution in Amazon CloudFront to reference the assets in Amazon S3
  4. Use the Amazon CloudFront URL when referencing your assets in your HTML
The CloudFront URL will be something like this:
//d1dejaj6dcqv24.cloudfront.net/path-to-your-asset