Cdnjs vs jsDelivr


I my last blog post I talked a little about the differences between cdnjs and jsDelivr but this was mostly based on an old Github issue written by Peter.

I was wondering is this still accurate?
What are the big differences, benefits using one compared to the other.

Also it seems (not 100% sure) that jsDelivr uses the API from NPM to search for packages so no need anymore for manual submission. Why is cdnjs currently staying with manual submission?

Just trying to open a positive discussion here :wink:

1 Like

jsDelivr pulls from Github/NPM - I am unsure if they then permanently, locally store the file or if they still have some reliance on GitHub/NPM being up.
With cdnjs, we store all versions ourselves and have no reliance on GitHub/NPM for fetching resources from the CDN - GitHub is only used by us to publish new versions/libraries which are then cloned to the Cloudflare origin servers.

This is currently how our infrastructure is set up, we publish resources to the central GitHub repository and then Cloudflare clones that to the origin servers. We try to ensure all the popular packages are available whilst filtering out packages that aren’t popular and would only waste disk space.

We have plans in the works to make the process of requesting new libraries to be added far easier than it is currently.

Let me know if you have any more specific questions :slight_smile:

1 Like

Thanks for the explanation!

According to the jsDelivr website they fetch it from NPM/Github and then permanently store it on their AWS S3.

1 Like

Ah okay, so if you were first to request a library/version, then there is reliance on NPM/GitHub to be functional. The size problem is probably the biggest thing then if they are storing every single version/library ever requested, permanently.


Indeed, and they also support combining multiple files into 1 and this will also permanently store the generated file.

Looking at their list of sponsors and the details of each tier (minimum amount) I don’t think they have a funding issue.

But still very interesting to see how they made their stack, and makes them more flexible to support new library providers. In theorie they could add a new library provider with minimal changes.

1 Like

Yeah, they certainly have a different setup from us. I think both jsDelivr and cdnjs have their own advantages, so I would say it’s very much down to the user which they want to use. (Obviously, cdnjs is the better choice)

1 Like