Here are some links on reducing the number of requests to improve performance.

http://yuiblog.com/blog/2006/11/28/performance-research-part-1/

http://developer.yahoo.net/blog/archives/2007/04/rule_1_make_few.html

http://developer.mozilla.org/en/docs/Tips_for_Authoring_Fast-loading_HTML_Pages#Minimize_the_number_of_files

To highlight another view on JS optimization, I just finished a
project for which I used the Dojo toolkit's build infrastructure.  It
is certainly Dojo centric though it will work non-Dojo Javascript.

http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/package-system-and-custom-builds

It has a concept of layers so you can push common javascript into a
single compressed file with page specific parts compressed into
separate files.  For JS using the Dojo package system it will only
pull in packages that are actually used.  So if you implement a widget
for your site that only uses Dojo's Dialog widget you will only have
Dialog and it's dependencies in your newly combined and compressed JS
file.

Their build uses ShrinkSafe, a patched copy of the Mozilla Rhino jar,
and their own JS glue code.  Despite the complexity it was simple to
use, however on the whole I would say it fails the easy-to-install
test pretty badly and really only makes sense for sites using Dojo.

On Jan 2, 2008 12:44 PM, Ian Bicking <[EMAIL PROTECTED]> wrote:
>
> Pedro Algarvio, aka, s0undt3ch wrote:
> >
> > ----- "Ian Bicking" <[EMAIL PROTECTED]> wrote:
> >> Pedro Algarvio, aka, s0undt3ch wrote:
> >
> >
> >> I've used ShrinkSafe on YUI and it worked fine.  I'm surprised it
> >> didn't
> >> work on jquery, it's supposed to be a pretty safe shrinker.
> >>
> >> A flag you could put in setup.cfg to choose the shrinker to use would
> >> be
> >> ideal.  Last I looked Yahoo didn't seem to have a service that did
> >> shrinking, and the installation was non-trivial.  The ease of using
> >> ShrinkSafe was really its biggest selling point for me.
> >>
> >> Note that the helper also combines Javascript files, which perhaps
> >> more
> >> important than shrinking the files.
> >
> > Combine JS's into a single file, but then which one would you call?
> > Always the compressed one?
>
> Well, if you have just one working set of JS (which probably is fine, as
> the improved caching from that is probably worth loading a little JS
> that you might not need for a particular page), then yes, you'd call the
> compressed/combined JS file in production (but maybe not in development).
>
> I guess it doesn't quite fit with the current web helper functions, as
> they are one-call-per-file, and you may have one or many files depending
> on whether you are using the combined files.
>
> > I've now tried the Yahoo's compressor:
> > 46195 2008-01-02 17:18 jquery-latest.min.js
> >
> > Size is always greater that those generated by ShrinkSafe.
> >
> > By the idea of ShrinkSafe, perhaps also add the minified keyword to 
> > stylesheet_link_tag.
> >
> > I'll see if I gather a patch for the webhelpers. By the way, where are 
> > patches submited now, still PylonsHQ?
>
> Yep.
>
> --
> Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to