Google's CDN is down (404)(ajax.googleapis.com)
ajax.googleapis.com
Google's CDN is down (404)
http://ajax.googleapis.com/
19 comments
Scripts are loaded serially if included in the HTML or inserted via document.write, but not if inserted via DOM methods. The defer and async attributes can be used to opt out of this behaviour on certain browsers.
Got it, thank you Ryan.
Google's CDN is not down, you are just requesting a file (/ in this case) that does not exist.
cdnjs.com (running on CloudFlare infrastructure) is an alternative to Google's CDN. We should have every major script, but if we're missing anything feel free to fork at https://github.com/cdnjs/cdnjs and we'll get it up asap.
Disclaimer: I'm one of the founders of cdnjs.
Disclaimer: I'm one of the founders of cdnjs.
[deleted]
As posted by somebody else it's also worth using a local fallback. html5boilerplate has been doing it for jQuery for some time now.
This can be done with most libraries by identifying the libraries global variable. e.g. for Modernizr
<script>!window.Modernizr && document.write(unescape('%3Cscript src="/public/scripts/libs/modernizr.js"%3E%3C/script%3E'))</script>
This can be done with most libraries by identifying the libraries global variable. e.g. for Modernizr
<script>!window.Modernizr && document.write(unescape('%3Cscript src="/public/scripts/libs/modernizr.js"%3E%3C/script%3E'))</script>
That page has always returned a 404
https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.mi... seems to be loading for me at the moment.
everything works correctly
https://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFI...
https://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFI...
A couple seem to be up and down. Dojo has been down pretty continuously.
edit still down http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.j...
edit still down http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.j...
The api site lists this as the correct url for dojo 1.6:
http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd...
and this one appears to be working currently.
http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd...
and this one appears to be working currently.
The great thing about distributed caches is that static resources can still be made available even if the source is down.
In fact dynamic resources can be served as well using the stale-if-error Cache-Control header. http://tools.ietf.org/html/rfc5861#section-4
In fact dynamic resources can be served as well using the stale-if-error Cache-Control header. http://tools.ietf.org/html/rfc5861#section-4
I just tried all the https URLs and they all seem to work just fine. Why aren't you using https BTW? It's free, fast(Google's SSL keysize is small) and secure.
I am really glad I added a fallback to local copies of the JavaScript libraries I use. My site is still up and running with no trouble. I wouldn't have even noticed the problem if it hadn't been for this post.
Perhaps Google+ killed Google CDN?
I definitely think it did. Google doesn't seem to be in the best of shape right now; Google+ got completely overwhelmed and started showing some serious bugs.
Title says: Error 404 (Not Found)!!1
For anyone that this freaks out and wonders how they can utilize the googleapis service in the future but have a fallback incase things fall apart, here is a fun little snippet that I got from the HTML5 boilerplate[1] project to help:
More or less, you try the Google CDN, then you try and execute your own script right after that checks for the existence of an API-provided element, if it's not there then the CDN failed and you load it directly from your own server.
TIP: You can use "!jQuery.ui" as the check for jQuery-UI if you are using that.
The first time I saw this approach I thought "well that's ugly", but it's the 0.01% of the time that it gets you out of a bind that I think makes it worth it.
Q: Does anyone happen to know if scripts are loaded serially in all browsers? Is there ever a scenario where the 2nd script executes before the 1st script tag loads from the CDN and inits the jQuery object?
[1] http://html5boilerplate.com/