CDN in Web and App Development: How Can You Use CDN in E-commerce?
According to statistics, 40-60% of users leave the site if it is being loaded for longer than 3 seconds, and 60-80% of them never return. Moreover, the delay in downloading a web resource in just 1 second leads to a decrease in traffic by 25-30%. The same applies to mobile applications. We’re guessing, it's time to think about CDN in web and app development, that is, about using CDN in e-commerce projects for your profit.
In this article, we will tell you how to use CDN for business purposes and what this technology means and includes. The topic is complex and fascinating at the same time, and we hope our tips will help you figure it out.
- What is CDN?
- Content delivery network architecture
- CDN Types
- Make your e-commerce project faster with CDN
- How to choose the best CDN provider?
- Top CDN providers 2017, 2018
- Custom CDN systems
CDNs are Content Delivery Networks that help improve the performance of your web server and reduce the load on your traffic.
But more specifically, what is CDN? This is a set of servers with specialized software that accelerate the delivery of content to the end user. Servers are located around the world in a way that makes the response time minimal. Content usually includes video and static elements of websites and applications (those that don't require the execution of code on the server or requests to the database, for instance, CSS/js).
Sometimes unaware people wonder: what is the content delivery network in comparison with hosting we're used to? Is there any difference?
In fact, CDN is just one type of hosting. But why not use it as a hosting server, you may ask?
The main reason is that CDN systems return the cached static page of the site. CDN servers convert dynamic web pages of your resource into static ones and store them in their databases. Therefore, you can not run the PHP script on CDN servers and use them as the primary hosting.
What is unique about CDN systems?
At the moment, there is no other technology capable of delivering content to consumers around the world faster than the CDN does.
How is this speed being achieved?
The fact is that every user around the world receives your content from the nearest CDN server. This ensures the maximum download speed of your site (or application).
- Content is being uploaded to the CDN;
- Data is being distributed to all local servers within the network;
- Content reaches every user from the nearest CDN node;
Of course, you want to know how to create a CDN server or where to find the best content delivery network providers, but let's start with seeing into the past.
CDN systems, how that started?
The sharp rise in the Internet in the mid-90s led to the servers failing to withstand such a crazy load. In the search for solutions to this problem, developers noted that there were two types of content: static and dynamic.
Dynamic content is generated by the server at the moment of receiving the request, most often with the active participation of the database. The static content is ready-made, and whoever sends the request, the server will give the same data (corrected to the possible ACLs).
That’s why the medium and large organizations began to distribute static and dynamic data from different servers located in several places, geographically distant from each other. This approach helped to significantly reduce the load on the sites due to the removal of static content to easily scalable servers. Then it was time for the content delivery network companies to appear. Each of them has found its way to use a content delivery network (CDN) as a business project, and quite a profitable one.
What is a content delivery network and what does it consist of? Let's briefly review the key elements of the CDN systems.
- Points of Presence (PoPs) that are situated around the world (ideally) and aimed at interacting with users nearby. PoPs usually include several caching servers.
- Caching servers which store and deliver cached content data.
- SSD/HDD + RAM located inside the caching servers. SSD/HDD means solid-state and hard-disk drives, RAM is a random-access memory.
Content delivery networks can be classified in many ways, we offer 3 main options.
#1. Classification by methods of the load distribution
- Load balancing upon a DNS request
This is the most commonly used option. The bottom line is simple: the user sends a DNS request to the CDN server with a given name. CDN systems return the IP address of the server that is closer to the user.
- HTTP redirect.
Here, the request is being redirected to a particular server that is closer to the user.
HTTP-redirect is also a very popular method of processing requests, but it has one drawback. The matter is that there is an additional HTTP-request needed Accordingly, there is an extra TCP-connection.
- URL substitution when generating an HTML page.
This is a good way of the distribution of load, but sometimes it takes a lot of server resources.
#2. Classification by the nature of content distribution within the CDN network itself.
- Large content delivery networks. They use a hierarchical tree with central content storage and several large regional ones. And there are a number of small storages that are in regional telecom operators' keeping.
- Small CDN systems. It is enough for them to create a "point-to-multipoint" scheme when one data source distributes its content to all other servers.
- Peer-to-peer network (P2P). Here, the content is being distributed as provided by the P2P principle. Servers download content to each other (similarly to the torrent systems).
#3. Classification by the method of determining the shortest path to the user.
- The geographical method. This is the most understandable way, which, unfortunately, is not always effective. The problem is that Internet providers may have complex relationships, there are so-called "peering wars" happening between them. Therefore, providers from the same city are routing traffic through a distant location.
- Shortest path definitions based on network topology data. These can be BGP routes or a RIPE database which should store the information about the networks, routes used, and existing peering relationships.
- Determination of the shortest path to the user by integral metrics. These metrics are closely related to network delays, the number of autonomous systems on the path to the user, etc.
As you can see, the question of how to create a CDN server is complicated and involves many pitfalls. But we do not advise you to abandon the idea to use a content delivery network in your favor. With the right approach, CDN in e-commerce significantly improves the efficiency of business projects.
The e-commerce market is oversaturated, and one has to fight for every user, every visitor to the site. And, as you've already understood, CDN systems play an important role in this process. This is particularly true for projects which tend to the scaling of the network infrastructure, constant traffic growth, regular peak loads, and the audience distributed across different countries.
Content delivery networks allow organizing an online broadcast to millions of users and distributing any static content at the highest speeds. These systems greatly optimize the site and accelerate its download.
In general, if you use a content delivery network, you're getting the real chance to increase the download speed of the entire web-page by 30-70%. The exact percentage depends on the amount of content (pictures, videos, "heavy" scripts, and styles, etc.).
And now, when the question "What is the content delivery network?" has been answered, it's time to decide who needs this technology, what is the benefit of using CDN, and how to implement it as efficiently as possible.
Who needs CDN systems?
Some say that if traffic is below a few terabytes per month, there is no point to use a content delivery network. However, in addition to easing the load on the server, there is also the concept of latency. And latency should be minimal: in other words, do not force your customers to wait.
And if you need to serve your customers as quickly as possible, then the amount of your traffic is no longer the case, and you must have more points of presence - PoPs that would be closer to the target audience. It means that you should think of using CDN in e-commerce projects.
Okay, who needs to use a CDN?
- Sites located on the cheap hosting with limits on load, free space, and other restrictions.
- Any site or application with high attendance and wide geography of users. For example, Wikipedia.
- Sites using streaming video: various online cinemas, TV channels, online games (for example, Twitch)
- Huge media portals that store a lot of information (photo stocks is a good example).
- Large e-commerce projects.
But the CDN is important not only to giant sites. This system is perfect for small resources (online and mobile shops, news portals, forums) because fast loading of web pages and app screens will be a strong competitive edge.
By the way, if your site is written on public systems, for instance, WordPress, it, too, may need to improve the quality of content delivery. If you have no idea how to configure CDN for WordPress, do not worry: the content delivery network providers usually help their clients to go through the whole process from A to Z without unnecessary hassle.
Benefits of using CDN
We, of course, have already discussed this, but let’s now systematize all that has been said.
Content delivery networks interconnection is a good thing because it means...
- Providing the best user experience and reducing the level of denial of site users (due to the high speed of the site load);
- The maximum speed of content delivery to an unlimited number of users anywhere in the world;
- Reducing the load on the server, because all requests to static files are being redirected to CDN systems;
- Saving on bandwidth and traffic from the hosting provider;
- The improvement in search engine rankings in Google: pages that have been loaded faster get a higher search ranking;
- Protection against DDoS attacks. Scammers find it more difficult to achieve their goal because this requires more powerful resources, it's much easier to attack sites that don't use content delivery networks. Therefore, additional protection will be a significant benefit of using CDN;
- Resistance to surges of site traffic
- Maximum coverage of your audience with the ability to target, validate and monetize traffic;
- Transcoding the stream to the desired format;
- Reducing the use of own resources (disk space, bandwidth...);
- Improving the reliability of the project. If access to the resource is blocked, copies of the site pages and application screens are still saved on the network.
CDN systems in web and app development
Now you understand why you should figure out how to create a CDN server or, if anything, how to look for content delivery network companies. And if you're aware of all the benefits and want to use them in your favor, you should follow these important steps:
#1. Analysis of your site/application
You need to find out why you want to use a content delivery network. To achieve the maximum result, you must set specific goals.
#2. Setting up the CDN systems
There are several options for using CDN. You can either take advantage of the free CDN provided by CloudFlare (as for example), or use paid analogs. If you have a small site with average traffic, a free version should be more than enough. However, with a heavy load on the site and server, it is recommended to order paid services of the top CDN providers in 2017, 2018 (we’ll list them below).
And you can customize a CDN system individually for your project. This option is useful for particularly complex resources, and we will consider it later.
#3. Testing changes
Once the Content Delivery Network has been successfully configured, you can run a site analysis on the WebPageTest to verify its operation.
Total loading time
Total loading time
108 (883.2 KB)
108 (883.2 KB)
9 (329.8 KB)
9 (329.8 KB)
There are many content delivery network providers, they differ in price, services, and quality. And you need the best CDN option (of course!).
Here are the main factors that should be borne in mind when choosing one of the content delivery network companies:
#1. Number of Points of Presence
The more points, the better, you may think. But the situation is much more complicated. For example, why do you need PoPs in Australia if you are interested in the American market? Therefore, when comparing content delivery network providers, you should see a list of points of presence and compare them with your potential audience.
#2. Cache policy
There are many caching schemes, for example:
- Replication of all content. This system is very effective and quite expensive at the same time.
- Replication on the 1st request (the most common scheme). The first request is usually slow, then the process goes faster.
- Asynchronous replication by exceeding a certain threshold of requests. This is a more economical version, although a greater number of clients would receive slow service.
#3. The retention policy
This is another important factor in choosing content delivery network companies (if you haven't decided to find out how to create a CDN server on your own).
The retention policy implies how and when the object is being removed from the server in the specific PoP. There are such options as:
- removal by timeout
- removal by reducing the number of requests below a certain value
- removal at a fixed time
#4. Extra services
CDN systems can provide additional services:
- real-time informing about the failure of individual points
- managing Cache Policy
- integration with CMS
- ready-made HTML/flash video players with CDN support
- DRM for content
Also, pay attention to supporting the necessary protocols and files. We don’t think that you want to deal with a provider that does not work with the technology that is significant to your purposes.
It's about the Service Level Agreement. We suggest that you clarify whether this SLA extends to all points of presence. And don’t forget to find out what are the consequences of nonobservance of the terms of the agreement by content delivery network providers.
#6. Different issues
Now it's time to discuss financial (and not only) issues. Feel free to clarify the following points:
- Is there a contract? And what is its minimum period of validity?
- How does the provider charge money: for megabytes or megabits per second?
- What should be expected when overcommitting (that is, exceeding the limit stipulated by the contract)?
Best CDN providers guarantee 24/7/365 support, but there are many other factors to take into account:
- Availability of your account manager.
- Level of qualification of support specialists.
- The speed of problem-solving.
Now let's look at the best CDN systems.
Besides the free service, the Cloudflare CDN network also offers paid tariff plans:
- from $ 20 per month for the 1st hosted site.
- $ 5 per month for each next hosted site.
In addition to CDN, CloudFlare provides the following services:
- Site protection from DDoS attacks
- Blocking a wide range of fishy IP addresses.
- Detailed analytics for sites.
- Optimization of sites for mobile devices.
- Integration of popular web applications: Google Analytics, Clicky Web Analytics, SiteLock.
MaxCDN is one of the most popular CDN systems. Tariff plans start from $ 39.95 per year for the 1st terabyte of bandwidth. After a year of use, the price increases to $ 99 / year for terabytes. And you can get a 7-day free trial to test the system possibilities.
MaxCDN is easy to integrate with WordPress, as well as with other CMS (Joomla, Drupal, etc.)
Available tariff plans:
- Business: 1TB of traffic per month
- Enterprise: from 15TB to 5PB traffic per month.
AMAZON S3 is in high demand among content delivery network providers.
Its tariff plan:
- from $ 0.095 per GB per month for data storage
- free bandwidth up to 1 GB
All that exceeds this traffic limit is estimated at 12 cents / GB / month. Moreover, the price for traffic and file storage decreases with the growth of the space used.
TinyCDN is part of the Amazon Web service, which ensures its high reliability. But the cost of services is high either: tariffs start at $ 9.95 / month for 500 MB for file storage and 10 GB of traffic.
To estimate all advantages of TinyCDN, you can order a 30-day trial use term.
GOOGLE PAGESPEED works on the basis of the Google CDN network and mainly focuses on the needs of developers. The service offers a wide range of online documentation.
Unfortunately, GOOGLE PAGESPEED has its disadvantages: the inability to use the service for domains without the www prefix, the lack of support for HTTPS pages and for streaming audio and video content.
RACKSPACE CLOUD FILES is a well-known CDN provider with flexible pricing policy. The cost of services starts from 18 cents / GB for CDN and 10 cents / GB for data storage.
There is the chat support, direct phone lines, and a reliable uptime guarantee. Rackspace CDN uses the Akamai content delivery network architecture.
CDN Akamai is the leader in the organization and distribution of content, this network covers more than 70 countries.
We've listed the most popular CDN providers but you have one more option, that is, the personal customization of CDN systems.
How to create a CDN server and why should you deal with this issue if there are experienced content delivery network companies?
The answer is really obvious: custom development of CDN systems allows taking into account all your needs and thereby achieve maximum effect. And the result will exceed the most optimistic expectations: your site or application will work way faster than the competitive service that uses the ready-made solution.
You can choose the best way to route and allocate PoPs, you will determine what data to cache. Content delivery network companies cannot provide you with such flexibility in full.
Well, finally, by creating custom content delivery networks, we invest money in our business infrastructure.
It's up to you what to choose. Just have in mind that more than 50% of shoppers of web and mobile stores claim that the speed of downloading a website or application greatly affects their loyalty. It means that you cannot do without CDN in e-commerce projects.
Still have questions? Contact us and we will be happy to consult you in detail.