jQuery libraries moved to Google AJAX Libraries API
Recently I've been doing a lot Web design and development work, using the Squarespace platform, a "A fully hosted, completely managed environment for creating and maintaining a website, blog or portfolio." I like Squarespace because it is xhtml/CSS based and lets me focus on a site's content and appearance. I get great performance and never have to deal with installing and managing any Web server software. Normally ...
Last night was the exception. I was working on some site updates, and every time I refreshed a page, there was an interminable delay while the page loaded. Coincidentally, I've been experiencing intermittent short outages in my AT&T U-verse service lately, so I put this down to another AT&T problem. But it was already after midnight anyway, so after trying a few things, I finally gave up and went to bed.
The first approach is ideal once your site is in production and everything is working, but while you're in development, it's convenient to be able to grab the latest library code and be sure that you'll automatically get the benefit of any recent bug fixes or enhancements. So I think a lot of developers take that approach. And I imagine that there's quite a lot of jQuery code out there, in every day use, and still relying on a download from code.jquery.com.
And here's where the performance problem arises. Yesterday, that library was relocated to ajax.googleapis.com:
code.jquery.com Redirected to Google Ajax APIsPosted August 20th, 2009 by Mike Hostetler
Starting at 10PM MT on August 20th, code.jquery.com will start redirecting (301) to ajax.googleapis.com [http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery].
- Redirection will occur using 301 “Permanent Moved”
- Packed version will be replaced with minified version
Full documentation of Google’s Ajax API are available at http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery. For your convenience here are the old URLs on code.jquery.com and their new Google Ajax API counterpart:
--for the full list, see the jQuery blog
Although the old downloads still work, it's been taking code.jquery.com a long time to issue those 301 redirects to the google library. In the meantime, your browser will sit there (probably with a message at the bottom saying "waiting for code.jquery.com" or something similar). If you see that, look in the source code, usually in the <head> section, for a jquery download that may be causing the problem. If you control the code, fix it. Otherwise call the tech support for the site and tell them what to do.Tags: jQuery, performance, ajax, Google, download time, Performance Matters, Web performance