As a developer, you may be aware of
Google Hosted Libraries . Google provides an easy and fast way to include the 12 most popular JavaScript libraries into your websites.
But what if you are a webmaster and want to take advantage of fast CDNs when used in other less popular projects? Or you are a developer and want to make your project more convenient to use and more accessible to other users.
This is where
jsDelivr comes into
play . jsDelivr is a free and free CDN, created to help developers and webmasters. It has no restrictions on popularity and all file types are allowed, including JavaScript libraries, jQuery plugins, CSS frameworks, fonts, and more.
Add Library
To add a new library or update an existing one, all the developer has to do is to clone our
Github repository and apply the modifications that it considers necessary. When the moderator looks at the pull request and merges it with the main branch, the files are immediately available on the
official website .
')
If the moderator is online, approval will take no more than 20 minutes, otherwise it may take up to 10 hours until someone appears online. However, as soon as our autoupdate application is ready, the review time will decrease.
Reliability
What really makes the project advanced? The idea of ​​jsDelivr was not to create another CDN, but to provide a very fast and reliable infrastructure that developers and webmasters can use to trust it. Any website, whether large or small, can use it without worrying. Our service is extremely reliable and has no restrictions on the width of the channel.
The long response time, timeouts and lack of service are unbearable, so we designed a unique system to overcome these problems, and offer a product that even an enterprise-level CDN can envy. Our highest priorities are continuous operation time and productivity. We are continuously monitoring everything and are always looking for new technologies and providers who could improve our CDN in the future.
Infrastructure

Unlike competitors, jsDelivr uses a unique Multi-CDN infrastructure to ensure the highest possible performance and uptime. Its main trunk network is built on top of CDN networks provided by
MaxCDN and
CloudFlare .
We also use dedicated dedicated servers where CDN networks have a small representation, or where they are not at all. In total at the moment it translates into 42 points of presence around the world. In the future, we plan to increase the number of placements in order to provide high performance even in less popular countries.
Of course, the many points of presence does not mean anything, if you can not properly balance the load between them. For the load balancing system, we use the services provided by
Cedexis . One of their main features is that they collect real-time performance data from all major CDN providers. Every day, up to 1.3 billion RUM performance tests (RUM - Real User Monitoring / Measurements - measurements made when users visit sites with real users, not robots) are processed and become available to all Cedexis users.
performance measurement
To gather data from these RUM tests, they deployed specialized JavaScript code on thousands of websites. Each visitor to any of these websites initiates the execution of this code, and as he browses the website, testing of various CDN providers begins in the background. Testing does not affect the feeling of surfing and is completely transparent to the user. You can see how this works by visiting our
website , opening the developer panel (F12) and going to the “Network” tab.
These tests are wonderful because they are not synthetic. They reflect the real performance that real users will get if they decide to download a file on one of these CDN networks.
The following information is subject to preservation:
- performance metrics for each of the providers
- accessibility metrics for each of the providers
- Browser Information
- The first three octets of the user's IP address
Now we have all the information we can use in the smart load balancing algorithm.
Each user receives a unique response based on their location and how they use the Internet provider. Every time a user decides to upload a file through jsDelivr, our algorithm takes data on availability and performance over the last few minutes, and then finds the most optimal provider for that user at that moment. And all this within a few milliseconds.
First of all, he makes sure that all providers are available. To do this, it uses RUM accessibility metrics and a synthetic test, which every minute checks each provider for operability. Next, providers are ranked by performance relative to the ISP for a given user and his location.
As soon as the fastest provider is located, its name is returned to the user. For example, 2 users from different Internet service providers in London can get 2 different answers, because their Internet service providers have different routes and different performance relative to CDN providers. This intelligent system guarantees maximum uptime and high download speed for all users. If the provider becomes unavailable, jsDelivr will not sense any problems and will immediately start using another provider.
This algorithm also instantly responds to performance degradation. For example, if the DDoS CDN provider in Europe and its response time increases, jsDelivr will notice the problem and simply stop using this provider in Europe, but still take it into account for users from the US and other places that are not subject to attack.
Do not rely on reliability and speed on a single CDN. Everything can fail, but the chances of two CDNs and multiple servers simultaneously being laid down are very small. That is why jsDelivr is the most optimal solution for any website. And no matter how big it is.
I should also remind you that MaxCDN, CloudFlare, Cedexis and
other companies support jsDelivr for free. It's nice to see that there are organizations that can help open source projects and build fast and free Internet.
Extended Features
jsDelivr also supports some interesting and very useful features, such as:
Aliasing versions
Instead of using a unique URL for each version to load a project, you can use aliases with jsDelivr. Take for example the Abaaso project. At the moment, the latest version is 3.10.50, and you can download it, as usual, by specifying the exact version in your URL. But since this project is updated very often, your used version will soon become obsolete. To overcome this problem, you can now simply use the following URL:
//cdn.jsDelivr.net/abaaso/3.10/abaaso.min.js
Using 3.10, you tell jsDelivr to load the latest version of the project from branch 3.10, which in this case is 3.10.50. This is the optimal solution for most authors, since they can download the latest support version without worrying about major changes that could disrupt their website.
Of course, you can download the latest version of the v3 branch using the following URL:
//cdn.jsDelivr.net/abaaso/3/abaaso.min.js
And if for some reason you always need to download the latest available version, you can use:
//cdn.jsDelivr.net/abaaso/latest/abaaso.min.js
Using “latest”, you tell the server to download the latest version that it has. Of course, this is dangerous, and sooner or later your site may be disabled. So use this feature with caution.
Uploading multiple files in one HTTP request
jsDelivr is the first CDN to support this kind of functionality. You can upload multiple files using a single HTTP request. Like merging and compressing JavaScript files on your own server, only this time it is in the cache of the huge and smart jsDelivr network.
All you have to do is create your own URL with the projects and files you want to merge, and their versions, if necessary. For example, to download the latest version of the abaaso, ace, and alloyui projects, you use the following syntax:
//cdn.jsDelivr.net/g/abaaso,ace,alloyui
Keep in mind that downloading the latest version is not recommended, and sooner or later it will bring down your site. That is why you must specify exact versions, or use version aliases:
//cdn.jsDelivr.net/g/jquery@2.1,angularjs@1.2
So, jquery@2.1 will load 2.1.0, and angularjs@1.2 will load 1.2.14. But the link above will download only the main files of each project, and nothing more.
If you want to upload several files of the same project, you can do the following:
//cdn.jsDelivr.net/g/jquery@2.1,angularjs@1.2.14(angular.min.js+angular-resource.min.js+angular-animate.min.js+angular-cookies.min.js+angular-route.min.js+angular-sanitize.min.js)
If you want to load CSS, select CSS files using the format above. If all files in the URL group have the .css extension, the server will automatically respond with the string “Content-Type: text / css” in the HTTP header. In all other cases (for URLs / g /) the string “Content-Type: application / javascript” is used.
Next, you simply include the URL in your website, and you're done. Fewer DNS requests, fewer TCP connections, fewer HTTP requests = faster website.
You can even use this feature and offer your users a constructor to enable them to generate URLs with the modules they need, and then load them using the quick CDN.
This API
jsDelivr has a full-featured
API that developers can use in their websites to create custom modules and anything else they can imagine.
You can request exactly what you need using our API, without downloading a huge JSON package. And it also supports cdnjs and google. Thus, developers have everything they need in order to create their applications.
Auto Updates
jsDelivr libgrabber is a utility that prepares for launch on our servers and will be able to automatically update all hosted projects if this feature is configured. The most important thing is that authors do not need to change anything in their repositories. All changes are made on the side of jsDelivr.
All you need is to create an update.json file inside the project with some basic information that you want to automatically update in the jsDelivr repository. This file also supports multiple sources for newer versions. Such as, for example, npm, bower and directly Github-repositories. This functionality is still under development, but is planned to be launched soon.
Help us - try it!
jsDelivr is a very interesting project that I like to develop and improve. It also relies heavily on
community assistance . Consider using it on your websites and post your projects on it.
And if you are interested in helping us, we can always accept any help, just join the conversation on
GitHub .
Feel free to leave your comments and ask me any questions you may have.
thank