CDN参考哪个jQuery版本? [英] Which jQuery version to reference for CDN?

查看:144
本文介绍了CDN参考哪个jQuery版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Google的jQuery CDN,以便用户有最大的机会已经拥有jQuery的缓存版本.

I want to use Google's jQuery CDN so that the user has the best chance to already have a cached version of jQuery.

现在我的问题是,如何确定最佳的jQuery版本以最大化用户已经拥有缓存版本的可能性?

Now my question is, how do I determine what is the best version of jQuery to maximize the probability that the user already has a cached version?

我应该参考最新版本的jQuery吗?还是最受欢迎的版本?

Should I reference the latest version of jQuery? Or the most popular version?

例如,最新版本当前是jQuery 1.9.0,昨天才发布.但是大多数站点可能还没有引用它,所以我最好使用1.8.3?

For example, the latest version is currently jQuery 1.9.0, which was just released yesterday. But most sites probably are not referencing it yet, so I would be better off using 1.8.3?

我认为我可以只查看Google或其他流行网站的源代码,看看它们所引用的jQuery,但是当我查看源代码时似乎找不到任何对jQuery的引用. /p>

I'm thinking that I could just look at the source code for Google or other popular websites and see which jQuery they're referencing, but I can't seem to find any reference to jQuery when I view the source.

推荐答案

在对您的网站进行全面测试后,我将使用最新版本.

I would use the most recent release after giving it a thorough test on your site.

当其他站点升级到新版本时,使用旧版本获得的任何性能提升都将在短时间内消失.

Any performance gain you would get today by using an older release will be lost in a short time as other sites move up to the new release.

看其他站点不是很有帮助,我只是尝试了一些.这些发布到处都是,Google,Twitter和Facebook似乎没有使用jQuery(至少不是按名称),并且stackoverflow使用的是1.7.1

Looking at other sites isn't very helpful, I just tried a few. The releases are all over the place, Google, Twitter and Facebook don't appear to use jQuery (at least not by name) and stackoverflow is using 1.7.1

这篇关于CDN参考哪个jQuery版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆