News for hackers. Stuff that matters.
Re:Jquery.com was down by dylanpyle on Tuesday December 11, 2012 @01:57AM (#4903442)
Possibly a good time for a reminder, folks: It's worth checking that if you're hotlinking to jQuery, it's the Google Hosted Libraries version.[1]

It looks like code.jquery.com survived whatever the present situation is (otherwise a big chunk of the 'net would be finding out right about now), but it's been made clear for a while [2] that use of the code.jquery.com/* URLs isn't encouraged.

[1]: https://developers.google.com/speed/libraries/devguide#jquer...

[2]: http://blog.jquery.com/2009/08/20/codejquerycom-redirected-t...

Re:Jquery.com was down by Jakob on Tuesday December 11, 2012 @02:05AM (#4903466)
Or, much better, have a local fallback:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="/js/libs/jquery.1.7.2.min.js"><\/script>')</script>
Re:Jquery.com was down by dylanpyle on Tuesday December 11, 2012 @02:12AM (#4903485)
Yep, should have mentioned this, definitely a sensible idea - I believe this specific snippet is taken from HTML5 boilerplate. Google is blocked in some countries!
Re:Jquery.com was down by degenerate on Tuesday December 11, 2012 @09:16AM (#4904572)
I didn't know a fallback could be so simple. Thank you x 3 (the number of scripts I remotely load)
Re:Jquery.com was down by akirk on Tuesday December 11, 2012 @03:21AM (#4903646)
This is especially valid as the Google server sends a far-future expires header (see below), so as soon as the browser has the file in its cache it won't even try to contact the Google server for a new version of the file.

So even if Google's servers go down, the browser will still use its locally available file (even without a possible delay, when waiting for a timeout).

  $ curl -I ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  HTTP/1.1 200 OK
  [...]
  Expires: Sat, 07 Dec 2013 05:29:17 GMT
  [...]
Re:Jquery.com was down by redact207 on Tuesday December 11, 2012 @01:58AM (#4903443)
Site's down, directing HN front page traffic at it will help bring it back
Re:Jquery.com was down by 19_ploT on Tuesday December 11, 2012 @02:04AM (#4903461)
Exactly.
Re:Jquery.com was down by BummerCloud on Tuesday December 11, 2012 @02:15AM (#4903490)
The main site is down, however the code library (http://code.jquery.com/) remains operational.
Re:Jquery.com was down by hkri on Tuesday December 11, 2012 @01:51AM (#4903417)
Oh no! The apocalypse here!
Re:Jquery.com was down by moepstar on Tuesday December 11, 2012 @01:54AM (#4903429)
Not being a web-dev guy i've never really understood why people insisted in including libraries from 3rd-party website..

Ok, i get that you might have a cache hit for a visitor that has visited a site with that exact same resource included before, but other than that, what am i missing?

Compared to events such as this, i'd rather host it myself and when i'm down, nobody cares because i'm down anyways..

Re:Jquery.com was down by jimwalsh on Tuesday December 11, 2012 @02:02AM (#4903458)
There are benefits to use a CDN, or one of the Google API hosting services. But yes, linking to a copy right on the jquery site, can't be encouraged.
Re:Jquery.com was down by firlefans on Tuesday December 11, 2012 @02:20AM (#4903504)
There are so many reasons not to do this. The potential site reliability risk of relying on someone else's free CDN (page not loading/loading slowly) far outweighs the slight benefit of CDN acceleration. When you CloudFront/Akamai your content, you have some sort of SLA, but don't complain when Google pull shared library hosting as they have many other free services.