添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • Jun 17-19 | jQuery Virtual Training
  • Sep 12-13 | jQuery Chicago
  • Oct 13-15 | CSS Dev Conf 2014
  • Learning Center
  • Try jQuery
  • IRC/Chat
  • Forums
  • Stack Overflow
  • Commercial Support
  • Members
  • Brand Guide
  • Donate
  • Earlier this week the jQuery CDN had an issue that made the jquery-latest.js and jquery-latest.min.js files unavailable for a few hours in some geographical areas. (This wasn’t a problem with the CDN itself, but with the repository that provides files for the CDN.) While we always hope to have 100% uptime, this particular outage emphasized the number of production sites following the antipattern of using this file. So let’s be clear: Don’t use jquery-latest.js on a production site.

    We know that jquery-latest.js is abused because of the CDN statistics showing it’s the most popular file. That wouldn’t be the case if it was only being used by developers to make a local copy. The jquery-latest.js and jquery-latest.min.js files were meant to provide a simple way to download the latest released version of jQuery core. Instead, some developers include this version directly in their production sites, exposing users to the risk of a broken site each time a new version of jQuery is released. The team tries to minimize those risks, of course, but the jQuery ecosystem is so large that we can’t possibly check it all before making a new release.

    To mitigate the risk of “breaking the web”, the jQuery team decided back in 2013 that jquery-latest.js could not be upgraded to the 2.0 branch even though that is technically the latest version. There would just be too many sites that would mysteriously stop working with older versions of Internet Explorer, and many of those sites may not be maintained today.

    As jQuery adoption has continued to grow, even that safeguard seems insufficient to protect against careless use of http://code.jquery.com/jquery-latest.js. So we have decided to stop updating this file, as well as the minified copy, keeping both files at version 1.11.1 forever. The latest released version is always available through either the jQuery core download page or the CDN home page . Developers can download the latest version from one of those pages or reference it in a script tag directly from the jQuery CDN by version number.

    The Google CDN team has joined us in this effort to prevent inadvertent web breakage and no longer updates the file at http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js. That file will stay locked at version 1.11.1 as well. However, note that this file currently has a very short cache time, which means you’re losing the performance benefit of of a long cache time that the CDN provides when you request a full version like 1.11.1 instead.

    So please spread the word! If you see a site directly using the jQuery CDN’s jquery-latest.js or the Google CDN equivalent in their script tags, let them know they should change to a specific version. If you need the latest version, get it from the download page or our CDN page. For both the jQuery and Google CDNs, always provide a full version number when referencing files in a <script> tag. Thanks!

    after reading these:

    “We know that jquery-latest.js is abused”

    “The jquery-latest.js and jquery-latest.min.js files were meant to provide a simple way to download the latest released version of jQuery core”

    I wonder why you don’t simply put a download button with latest instead of keeping this version in the CDN.

    Having it there is like a colorful candy/chocolate bar for developers.

    If the message is “DON’T USE LATEST FROM CDN” and it’s for dev purpose only, put in such version only a console.warn(“latest support from CDN is being removed”) for 3 months and drop it after that time.

    I am also in favor of a console warning. Not a deprecation warning, but a simple warning for those who simply do not know that.

    try{console.warn(“The version of jQuery used by this page is not meant to be used in production. Also, it is no longer updated, so there is no use for it anymore. For more details, see http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/ “);}catch(e){}

    That should be enough for the innocent cases of sites that are maintained by developers who simply thought they were following the rules and should not worry about any breakage.

    Frankly, I cannot think of a reason not to add such a warning right now.

    Simply have the CDN insert a 1 second delay before serving the file contents (of jquery-latest.js).

    Consumers will soon stop using it in production sites.

    I’ve emailed http://jquerylatest.com/ about this blog suggesting they put a notice on their site.

    I’ve also posted a link to this blog from Stackoverflow:
    http://stackoverflow.com/questions/441412/is-there-a-link-to-the-latest-jquery-library-on-google-apis/24802890#24802890

    In response to the first comment by Andrea, I agree, serve it as a download. even better, just set the headers as an octet-download stream which forces the download. :)

    Good to know we’re not alone in this as we used it as a CDN file as well on a couple of sites.

    Recent Posts

  • jQuery 3.7.1 Released: Reliable Table Row Dimensions
  • jQuery 3.7.0 Released: Staying in Order
  • jQuery 3.6.4 Released: Selector Forgiveness
  • jQuery 3.6.3 Released: A Quick Selector Fix
  • jQuery 3.6.2 Released!
  • jQuery 3.6.1 Maintenance Release
  • jQuery maintainers continue modernization initiative with deprecation of jQuery Mobile
  • jQuery maintainers update and transition jQuery UI as part of overall modernization efforts
  • jQuery project updates addressing temporary CDN issues
  • jQuery 3.6.0 Released!
  • Archives

  • August 2023
  • May 2023
  • March 2023
  • December 2022
  • August 2022
  • October 2021
  • June 2021
  • March 2021
  • May 2020
  • April 2020
  • May 2019
  • April 2019
  • August 2018
  • January 2018
  • March 2017
  • September 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • September 2015
  • July 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • May 2014
  • April 2014
  • March 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • August 1997
  •