For CDN Wikipedia states: “A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance. CDNs serve a large fraction of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on-demand streaming media, and social networks.”
In simple words CDN is a cluster of geographically distributed servers being used to deliver static content to visitors from the nearest server.
CDN are very helpful to load any specific file on any webpage. Many developers preferred to use CDN over using local (hosted on their own server) version of the file. CDNs focus on improving performance of web page delivery.
Below is the list of five popular CDN for jQuery library.
1. jQuery CDN
<script src=”https://code.jquery.com/jquery-2.2.4.min.js” integrity=”sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=” crossorigin=”anonymous”></script>
2. Google CDN
4. CDNJS CDN
5. jsDelivr CDN
Note: CDN does not provide beta release of libraries.
Pros of CDN
- Low Bandwidth: Content delivered from the nearest server, that save network bandwidth (data transfer)
- Speed: CDN provide faster page loads and performance because CDN copies the static content over several geographically dispersed servers, hence content loads from nearby server of your location
- Easy integration: You can easily integrate CDN with well-known CMS (content management system) like WordPress, Drupl, Joomla.
Cons of CDN
- Data loss: Some time it may happen that content is not available so more on CDN in that case you need to update the line of code with available script or library
- Blocked access: As CDN uses multiple severs located geographically in multiple Countries so It’s not uncommon for any organizations or whole Country to block the domains or IP address of popular free CDN services
- File size: File served by CDN may not be optimized or minified.