从 jquery.com 热链接 jQuery 是否不好?
这可能会得到一个相当令人讨厌的响应,但我的服务器目前不是最快的,如果我从 jQuery 主页热链接以便他们服务器内容,我的网站加载速度会更快。这样做不好吗? jQuery 最终会从页面中删除这些 js 文件吗?
This will probably get a pretty nasty response, but my server isn't the fastest at the moment, and my site loads much faster if I hotlink from the jQuery homepage so they server the content. Is this bad to do? Does jQuery eventually remove those js files from their page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
最好从 Google API 库 热链接它。
非常大的优点:
Better hotlink it from Google API libraries.
Very big advantages:
您是否使用他们的官方 CDN? (旧链接)很多人都这样做。
我不知道为什么每个人都这么快说谷歌。上面的链接非常明确地表明您可以热链接到 jQuery CDN:
Are you using their official CDNs? (old link) A lot of people do.
I'm not sure why everyone is so quick to say Google. The above link says very specifically that you can hotlink to the jQuery CDN:
请改用 Google 的 CDN。这就是它的设计目的。
Instead use Google's CDN. That is what it was designed for.
如果它很糟糕,我还没有听说过。不过,您可能可以使用 CDN 来获得更好的性能。 Google 和 Microsoft 还通过其 CDN 免费提供 jQuery。
cdnjs:
https://cdnjs.com/libraries/jquery/
Google 的 CDN:
http://code.google.com/apis/libraries/devguide.html#库
jQuery 的 CDN:
http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery
MS 的 CDN:< /强>
http://www.asp.net/ajaxlibrary/cdn.ashx#Third- Party_Files_on_the_CDN_14
if it is bad I haven't heard about it. However you can use a CDN for better performance probably. Google and Microsoft also serve jQuery through their CDN for free.
cdnjs:
https://cdnjs.com/libraries/jquery/
Google's CDN:
http://code.google.com/apis/libraries/devguide.html#Libraries
jQuery's CDN:
http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery
MS's CDN:
http://www.asp.net/ajaxlibrary/cdn.ashx#Third-Party_Files_on_the_CDN_14
如果该库不适合从 URL 加载,我会避免使用它。
不过,Google 提供了托管版本:
http://code.google.com/apis/libraries/
If the library is not intended for loading from the URL, I would avoid it.
However, Google provides hosted versions:
http://code.google.com/apis/libraries/
您可以使用 Google Libraries 并从那里链接它:)
You can use Google Libraries and link it from there : )
您应该使用 Google 的托管版本:
http://code.google.com/apis/libraries/ devguide.html
You should use Google's hosted versions:
http://code.google.com/apis/libraries/devguide.html
是的,这很糟糕。对于您的网站 - 它会运行得更慢。对于他们的网站 - 想象一下如果每个人都使用它会发生什么!
Yes, it is bad. For your site - it will run slower. For their site - imagine what happens if everyone used it!