views:

208

answers:

2

I know that when linking to libraries such as jQuery that are hosted on Google Code it's better to link to the hosted one (Google's).

But when there are other libraries and frameworks hosted on sites such as GitHub (like this jQuery LightBox, do you think its best to link to the library directly from GitHub, or should I download it and link to the local files?

+4  A: 

It is better to download it and link to the local files. On git hub you cannot be certain that the file is going to stay the same. If the developer updates the file and it breaks your code you are going to have to fix the code or download the old version and link locally. Also this sort of linking is not the focus of git hub and there is no guarantee they won't disallow the ability to do such things in the future breaking your site and forcing you to link locally.

shit a birck
If you code an app for a customer who relies on that app, you don't want to explain to him, that his expensive website broke, because some service on the other side of the world quit or some guy you don't know committed something anywhere. +1
Boldewyn
+2  A: 

The Google Code JavaScript hosting is optimized for serving the files quickly and reliably. GitHub, while totally awesome for sharing code, is not necessarily speedy or reliable. Definitely download those libraries from GitHub and host them yourself.

Neall
As long as 'CDN' doesn't stand in huge, red letters somewhere, and you absolutely trust this service, use a local copy. +1
Boldewyn