Thursday, November 20th, 2008

CDNs Gaining Broader Use with JavaScript Libraries

Category: Ajax, Cloud, jQuery, Sencha, Yahoo!

YUI and Google

Most everyone knows that Google has really stepped up to the plate by helping many JavaScript library projects host their builds on the Google AJAX Libraries API. Apart from providing a central distribution point for these libraries, the bandwidth cost savings alone go a long way in helping frameworks service their users in a sustainable manner.

Google continues it’s commitment to helping out by adding the Yahoo UI to the growing list of supported JavaScript libraries.

Thanks to Vadim Spivak at Google and Dion Almaer (now at Mozilla) for helping to make this additional option available to the YUI developer community. We love that Google is supporting web developers in this way — grabbing YUI files from Google’s global infrastructure is a fantastic option to have.

This is great news for YUI developers who now have a choice of linking directly to YUI via and YUI team lead, Eric Miraglia, has a great write-up on the YUI blog about this and goes into detail on how the framework’s users can take advantage of this new hosting option.

jQuery and Amazon CloudFront

With nearly 2.5 million requests per day to the jQuery website, the jQuery project team is constantly on the look out for ways to decrease hosting costs while still managing the growing number of requests for the site’s resources. Originally leveraging Amazon S3 for many of their static pages, the project has now turned to Amazon’s new CloudFront CDN. The change has allowed for jQuery pages to be globally hosted as opposed to being centrally located in Amazon’s Seattle-based S3 hosting center.

In tests, John Resig, team lead for the jQuery project, noticed substantial performance gains based on the switch:

I ran a similar test here in Boston and even managed to see a large improvement. I was seeing latency of anywhere from 50-200ms on Amazon S3, but only a latency of 17-19ms with CloudFront.

What does all of this mean? It means that the jQuery site is going to load even faster than it does now. We already receive some excellent hosting from Media Temple but being able to off-load these static files to the fast-loading servers will only make for a better browsing experience.

In less than 24 hours the project had received almost 2.5 million requests for over 50GB of data. The only drawback is an increase in bandwidth costs but still substantially less than that of a traditional hosting plan. The jQuery project makes use of the Google AJAX API as well and recommends it as choice for linking to the jQuery and jQuery UI libraries.

Ext JS and CacheFly

The team at Ext JS has taken an interesting approach to CDN usage by extending their library build manager to allow users to host their own custom build on the CacheFly CDN.

The hosting is free and what makes it unique to something like the Google CDN is that it allows Ext developers a central access point for their own custom builds.

We are pleased to announce that Ext has partnered with CacheFly, a global content network, to provide free CDN hosting for the Ext JS framework. Cachefly’s globally distributed network and aggressive caching accelerate the delivery of web content like JavaScript and CSS, making for an even faster Ext experience.

Posted by Rey Bango at 11:16 am

4.1 rating from 50 votes


Comments feed TrackBack URI

Rey, perhaps it’s worth noting for the new reader that Dojo has been using CDNs for a couple of years now.

Comment by alp — November 20, 2008

Looks like Google truned down hosting Ext due to licensing issues with Ext.

Comment by PeterCr — November 20, 2008

@PeterCr: I know this is not the right place to ask, but do you have a link to some information about the consequences of Ext being GPL licensed? I tried finding out wether this means the server side part of a project that uses Ext-JS (not Ext GWT) should be GPL’led too if the software itself is not distributed, but is used by many people, but I can’t find an answer to this question, neither on te Ext site nor on the GPL license sites.

Comment by daanlib — November 20, 2008

Here’s what Jack aka self proclaimed legal expert says about this:

“This is correct for any code that is, for example, just sending down JSON or XML. If you are generating any markup or javascript code via the server in a page SPECIFICALLY designed for Ext, then that server code will have to be GPL as well.

For example:

– Suppose you have an index.php that includes Ext JS. According to the FSF, in that case index.php would be also under GPL since it is using ext. Since it must be GPL, it’s source must be distributed. Since it is GPL, the “viral” effect of GPL is now in effect and any thing that uses index.php (if anything) on the serverside would also fall under the GPL. (Note: Note this is a pretty gray area)

– Suppose you are using server-side code to generate javascript that interacts with Ext JS. That code must also be GPL.”

Comment by viper2k — November 20, 2008

I just don’t get the Ext hate. First they complained that the library wasn’t free enough, so the ext guys gave it the most radical of the Free licenses, the GPL, and now they complain yet again that it’s not free enough. Seems to me the complainers just don’t want any license in which the developers get paid for their work.
The whole situation sharply reminds me of the qt license debates. It is an exact replay of that story, and I’m on the side of the qt and ext guys on this one.

Comment by Joeri — November 21, 2008

Good point ;)
There’s another option to CDNs you know, which is to use an insane small amount of JavaScript – like Ra-Ajax ( ) does – less then 20KB i total. And it’ll mostly never grow to more than 10-15KB in your own apps…
In fact at our samples section our Google Analytics inclusion script is *more then half* the entire JavaScript on the pages… ;)

Comment by ThomasHansen — November 21, 2008

@Joeri: I guess the problem is the choice for the GPL license, instead of the LGPL. This makes it impossible to use Ext in projects that aren’t completely GPL licensed, as viper2k explaines above. For many people this is an obstacle.
Personally I think Ext is great, and I am prepared to buy a commercial license, but using the GPL for a library prevents people from using it, because they have to publish their complete source, instead of only the changes/additions they make to the library.

Comment by daanlib — November 21, 2008

Typo in the first paragraph: “…helping frameworks service there users in a sustainable manner.” Should be “their”.

Comment by excalo — November 21, 2008

@daanlib: If Ext was licensed under the LGPL, it would be straightforward to build closed projects on top of it without buying the library. Nobody would pay for it. Ext doesn’t have the corporate sponsorship of YUI or the huge developer community of dojo to survive something like that.

Comment by Joeri — November 21, 2008

Joeri – you seem to have a lot of “inside” Ext perspective, if you get my drift.

First you say :

“First they complained that the library wasn’t free enough, so the ext guys gave it the most radical of the Free licenses, the GPL, and now they complain yet again that it’s not free enough.”

Radical of the free licenses, huh? Have you heard of BSD or MIT? GPL is the most viral licenses.

You then go on to say ”
“Ext doesn’t have the corporate sponsorship of YUI or the huge developer community of dojo to survive”

Is this your sorry excuse to defend Ext? There are other libraries like Moo and JQuery with the most radical of free licenses without any weak excuse from an insider.

Comment by viper2k — November 21, 2008

@viper2k: Please, personal attacks have nothing to do with the matter. (Btw, I wish I was an extjs insider, because I think it’s a really cool project.)
I don’t get why some people get so mad at the Ext guys for trying to earn a living from what they do. Ext is not comparable as a project to jquery, mootools or dojo because the way the development of those projects gets funded (and make no mistake, they all get funded somehow) does not seem to be feasible for Ext. I wish Ext was BSD as well, but I just don’t think it’s possible, and consider the LGPL dual license the best possible compromise.

Comment by Joeri — November 21, 2008

@excalo Thank you for catching that. Fixed.

Comment by Rey Bango — November 21, 2008

Joeri – Ext is GPL not LGPL – HUGE difference

Comment by PeterCr — November 21, 2008

ThomasHansen: Those shameless plugs of your home cooked rajax library are getting old. It’s pretty obvious you plug it every time you get the chance. It would’ve catched on already if it didn’t suck, ajaxian doesn’t need spam on the menu, try something different.

Comment by lovejs — November 22, 2008

@lovejs: While I agree that self promoting on websites and forums as a form of marketing is not a good thing, it unfortunately seems to be prevalent in every field…video games, music, etc. Guerilla marketing is everywhere. However, I also think that if you’re going to say something “sucks”, you should explain why. It would help newcomers determine what product would be the ideal match for them based on other people’s opinions.

Comment by pharmx — November 23, 2008

pharmx: I mentioned why… Things that don’t catch on after a more then decent amount of shameless “marketing” plugs generally suck.

Comment by lovejs — November 23, 2008

I also think that if you’re going to say something “sucks”, you should explain why. It would help newcomers determine what product would be the ideal match for them based on other people’s opinions.
Just look at my previous comments in reply to Thomas on earlier posts for more depth to the arguments:

Comment by TNO — November 24, 2008

Leave a comment

You must be logged in to post a comment.