Is there a publicly available CDN that hosts JSON2?

JavascriptJsonCdn

Javascript Problem Overview


It's well known that Google and Microsoft host several common javascript libraries on their CDNs (content distribution networks). Unfortunately neither seems to host JSON2.js.

I'm aware that I could upload a copy of JSON2.js to my server and serve it myself, but there are a number advantages CDNs offer that I would like to take advantage of.

So with that in mind, are there any publicly available CDNs that host JSON2? If not, any idea why? Is there some sort of copyright reason?

Javascript Solutions


Solution 1 - Javascript

Checkout cdnjs.com

http://cdnjs.com/libraries/json2/

Might also be worth investigating Json3

http://cdnjs.com/libraries/json3/

UPDATE: Some of the information was out of date, changed to better links.

Solution 2 - Javascript

json2.js can be found on http://api.yandex.ru/jslibs/">Yandex CDN servers.

Full version: http://yandex.st/json2/2011-10-19/json2.js

Minified: http://yandex.st/json2/2011-10-19/json2.min.js

HTTPS also works.

Solution 3 - Javascript

I think probably it's too early to expect the big CDNs to start doing this. When enough sites are using a library, the benefits become clear: greater availability, more frequent use, reduced client requests, increased performance for the end user. If only a few sites are using it, chances of client having a copy in their cache already is low and all performance boosts are lost. So all that's left is that MS and Google offset your bandwidth charges, which is not their intention. Thus, the solution is to get more developers to use the library.

Plus the library is so tiny. The code is still only 3.5KB using conservative minification. For comparison, jQuery is 24KB and ext-core is 29KB. I'd personally recommend folding the library into your own site's base JS and get your performance boost there. At least until there's wider acceptance.

Plus, it's funny I'd have expected the JSON library to be hosted also at Yahoo, but I can't find it. I mean Crockford works there.

Solution 4 - Javascript

Thomas from cdnjs.com here with two quick reasons why there is no minified version.

  1. The script may not possibly function as the author intended using the method of minification we choose.
  2. As a security step we ensure that all files checksums match the original authors hosted files so community submitted updates cannot contain malformed minified code.

So for now that leaves us hosting Crockfords hosted un-minified version; https://github.com/douglascrockford/JSON-js/raw/master/json2.js

Solution 5 - Javascript

There is now.

Douglas Crockford recently put JSON2 on github, this url will always link to the most recent version.

Edit: Its not a good idea to use this method, see my comment below.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionXaviView Question on Stackoverflow
Solution 1 - JavascriptDavidView Answer on Stackoverflow
Solution 2 - Javascriptthorn0View Answer on Stackoverflow
Solution 3 - JavascriptAndrewView Answer on Stackoverflow
Solution 4 - JavascriptThomas DavisView Answer on Stackoverflow
Solution 5 - JavascriptDannyLaneView Answer on Stackoverflow