admin管理员组文章数量:1241124
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?
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?
Share Improve this question edited Oct 27, 2010 at 2:50 Bill the Lizard 406k211 gold badges572 silver badges889 bronze badges asked Jul 14, 2009 at 10:06 Andreas GrechAndreas Grech 108k101 gold badges303 silver badges362 bronze badges2 Answers
Reset to default 14It 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.
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.
本文标签: cachingJavaScript Link from GitHub or link to local fileStack Overflow
版权声明:本文标题:caching - JavaScript: Link from GitHub or link to local file? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740044199a2221835.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论