The geographical proximity between server and client is a key factor for the performance of an e-commerce website. An online shop can have a different loading time depending on the location of the server and the customer. For example, if your server is located in the AWS data center in Frankfurt, it may result in a different loading time for users outside Europe (for example, when serving customers in North America and Southeast Asia). The solution to this challenge is to use a Content Delivery Network (CDN). This article deals with what a CDN is and what advantages you have in terms of performance, availability and security of a website when using a CDN.

What is a CDN?

A Content Delivery Network is the term used to describe a geographically distributed group of servers (nodes) that provide different resources of a web page to each other, whereby the same content is replicated in different regions of the world. For example, a CDN allows web resources (such as JavaScript, CSS, and images) to be quickly made available regardless of where the user is located (as long as a server from the CDN network is geographically close to the user).

How does a Content Delivery Network work?

A Content Delivery Network is not a classic web server that can run dynamic content, but a cache that relieves the web server and can therefore effectively improve the performance of a website. Instead of dynamic content, users are provided with static copies of content that rarely changes, such as JavaScript, CSS, or images. The content is first loaded into the cache and from now on only the copy of the resource is delivered to the users. If the online shop operator lets something change in the original, the cache must be invalidated and the process repeated.

However, it is also possible to provide a complete website via a CDN. This requires that the content is identical for all users and does not contain any cookies. Individual content, such as a shopping cart or a customer account, is not kept in the cache of the Content Delivery Network. Personalized content is made available to the user directly from the original server without including the cache.

What are the advantages of using a CDN?

Below is a summary of the major benefits of using a properly configured CDN:

  • Improved page load time (latency reduction): Using a CDN has two advantages in terms of website performance. First, the client receives the requested content from a CDN node that is geographically located in its immediate vicinity. In concrete terms, this means that a customer from Southeast Asia is also served from a node in Southeast Asia.
    Second, the load on the original web server is greatly reduced because the delivered content consists of static resources from the cache. It is logical that content stored in the cache/RAM is delivered faster and more resource-efficiently than content that has gone through the NGINX, PHP-FPM and MySQL process chain.
    For the second reason, the use of a content delivery network makes sense even if the customers are located exclusively in the same region and you do not operate internationally.
  • Reduction of hardware costs: The intermediate storage of the contents relieves the web server enormously, since far fewer HTTP requests reach it, as the CDN intercepts most requests. This means that a smaller server instance can be used for the original web server. This results in savings for the online shop operator, since the cpu power of a CDN node is usually much cheaper than that of a vServer.
  • Increased availability and redundancy of content: A Content Delivery Network is a highly redundant and globally distributed network of servers designed to handle even the highest loads of HTTP requests. This means that the reliability of providing Web resources is much higher when using a CDN, than if you were providing your content on a sole source server (unless you are using a multi-server environment and AWS Auto-Scaling). In addition, intelligent failover ensures uninterrupted operation even if one or more nodes fail. The failover mechanism then automatically transfers the data traffic to other CDN nodes.
  • Protection against DDoS (Distributed Denial of Service): CloudFront, Amazon's content delivery network, is protected against DDoS attacks by default. So you can sit back and relax, your resources are in safe hands.

If you want to improve the performance of your online store, you should now switch to one of our managed hosting solutions. Use the AWS CloudFront Content Delivery Network - properly configured and managed by Storepace.