Search This Blog

Library CDNs or hosted libraries

posted on Tuesday, September 18, 2012

A CDN what? A CDN! A content delivery network!

In the broad definition of the term, a content delivery network is a group of servers that distributes all sorts of content to end-users. This content could be anything from images, scripts to entire applications.

In our context - the "I'm posing as a front-end developer and I need to know everything about jQuery, javascript and scripts in general" context - a CDN is simply a platform that hosts these script libraries for you!

Since these platforms consist of many servers, they are able to provide stable, reliable, high-speed, global access to these libraries. You can find pretty much all popular, open-source JavaScript libraries available on a CDN.

The idea behind these CDN's is that in your application, you link to the libraries hosted there to improve the performance of your application. And in case you're wondering, yes, this is free!

Also useful to know is that these platforms will start distributing the newest versions of libraries as soon as they become stable, off course they will keep distributing older versions as well.

On top of that these files will be cached on many CDN servers but also in your end-users browsers, boosting the performance of your application even more.

Links or it never happened? Okay...

Google has a very popular CDN (duh!) called Google Hosted Libraries:

But also Microsoft distributes jQuery files, specifically those that are popular to implement in ASP.NET applications:

Obviously, there's a lot more JavaScript library CDN's out there, but I tend to stick with these ones since the big names attached to them ensure my good night's sleep.

So, for those still in the blue about how it works... Just go to one of the links above and find the library you are looking for. There will be a link that refers to their site, containing the script file. All you have to do is copy that link and use it in your application to link to the file, just like you would with any other script file.

And that's all!

Could be useful, right?

No comments:

Post a Comment