Open In App

What is CDN?

Last Updated : 03 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

What is CDN?

CDN stands for Content Delivery Network. It is a network that helps to speed up web page loading for web users. It is spread all over the world as usage of the internet is everywhere. It is basically a distributed system of servers that stores the data by the use of Amazon Web services or Google Cloud storage, and it serves that data to the user via the nearest server so that the loading or buffering of web pages is low.

How it works?

The CDN is a collection of servers or a network of all the servers that deliver data all over the world to the web user. It has three main components, each component has its own value and role to play.

The first one is the Origin server which stores all the data spread all over the world. It is the main server that handles every delivery and also it maintains the updated version of data.

The second one is the Edge server which stores temporary data means it stores a copy of the original data temporarily. also, It is the one that delivers the data to the web user. The number of Edge servers is many, the nearest Edge servers deliver the data to the web user so that there should not be any delay in between the loading of the page on the web.

The third one is a DNS server that keeps track of the IP addresses. whenever a user sends a request through the internet on the web browser then in response to that request the Origin Server gives the IP address. By accessing that IP address the user gets their data on the web.

Why is it important?

CDN’s primary purpose is to reduce the latency and reduce the delay between the communication of request and response through the internet. As this world is so big and everything is working on the internet that causes a lot of traffic on the internet or website that results in reducing the speed and security.

CDN provides the fastest delivery of data across the network and protects the data from DDoS attacks. It improves the efficiency of the communication between the client and the server. It reduces bandwidth consumption, provides security, the fastest delivery of data, and improves the customer experience.

Benefits of CDN

  • Fastest Delivery: It delivers the data very fast because of Edge servers that are spread all over geographical areas. It handles the web traffic which also helps in decreasing the page load time.
  • Bandwidth cost: It reduces the bandwidth cost, as it provides the caching system which helps in maintaining the bandwidth consumption over the network.
  • Availability: The Origin server stores all the data if any of the data gets updated the Origin server keeps track of that and updates that data immediately.
  • Security: It provides all the security to the web pages. It has all the protection to prevent any security breach.

Example: This example shows the use of CDN for jQuery.

HTML




<html>
  
<head>
    <title>The jQuery CDN example</title>
    <script src=
        integrity=
"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
        crossorigin=
"anonymous" referrerpolicy="no-referrer"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            document.write("Hello geeks from GeeksForGeeks!!");
        });  
    </script>
</head>
  
<body>
    <h1>Hello</h1>
</body>
  
</html>


Output:

CDN

Output

FAQs

1. Can CDNs handle dynamic content?

yes, CDN uses many techniques to handle the dynamic content that’s why it is able to serve fast page loading.

2. Are there any downsides to using CDN?

It can be inital setup complexity, potential cost, and some occasional challeneges comes with loading of dynamic content.

3. Can CDNs be used for streaming media?

Yes, It also play efficient role in streaming the media so that there should not be any buffering occurs between the streaming of the CDN.

4. How does CDN increase performance?

By providing the fastest page loading web pages, security, availibity of data all the time it increases the performance and customer experience towards CDN.

5. Can i use multiple CDNs simultaneously?

Yes, You can use multiple CDNs but there is a chance of conflict if two or many of them share the same resource and opposite features then there is a chance of redundancy and low performance.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads