views:

66

answers:

2

Hi Guys,

Just curious to know if yui improves performance? As all the css and javascript files are on the YAHOO servers and only a part of it is loaded when needed. so does it help in improving performance?

Thanks

A: 

What exactly do you mean by "performance"?

Yahoo's servers are probably faster than yours, it saves you bandwidth, other visitors might already have the file cached, and of course not loading stuff you don't need will speed things up.

Mark
Can you explain me "other visitors might already have the file cached". As far as i know the particular CSS and javascript will be download when requested.
Josh
Nishant you need to know about CDN first then you will know what mark is trying to explain
Pandiya Chendur
How elitist, it's not that hard to explain.
e-satis
e-satis - and the reason YOU didmn't explain it (if it's so easy) was?
DVK
@Nishant: If YUI is hosted on your site, and the visitor has never visited your site before, they will have to download it. Since Yahoo is quite popular however, and many other sites link to YUI hosted by Yahoo, there's a decent chance they already have it cached somewhere.
Mark
+3  A: 

YUI does not improves performances by itself, it's a set of tools that can help you to develop faster. Now, you may be confused by something you read previously on the net about perf, and here is what you have to know :

  • YUI includes tools to compress and load dynamically your jJavascript files. Therefor you can make their loading more efficient. You can gain performances, or perceived performances, from using it.

  • YUI contains a Javascript framework that is probably better that any code you can write yourself. Since you can include this code to replace yours, and knowing that you can make it so it is downloaded from the very fast Yahoo! servers, then yes, you gain performances here too.

  • Therefor, if a file comes from Yahoo! servers, a lot of people will likely have already visited a page doing the same, and already downloaded the javascript code. In that case, their browser kept a copy of the files in cache, so they don't have to download it twice and no download means better performances.

Now, you must know that this is not specific to YUI. Closure, Mootools, Prototypes and JQuery offer similar features, and you can use the Google servers to provide them.

e-satis