[ale] Making the argument for many scripts vs one big one.

Michael B. Trausch mbt at naunetcorp.com
Wed Jul 24 13:08:36 EDT 2013


On 07/24/2013 08:29 AM, leam hall wrote:
> Any supporting ideas for pushing the argument of "Use lots of small
> scripts for a big task, instead of one large one"?

When developing, always do that.

In production, however, you should use something like the Closure
compiler from Google to take all of your JS code and minify and
concatenate it into a single script.  This significantly speeds up load
time, as each request required which is greater than the browser's
connection limit will kill page load times.

For site chrome (image files that are presentation, not content), the
same strategy should be used:  all images should be placed into a single
large image and CSS used to render the fragments ("sprites") at the
appropriate times and places.

I'd also recommending merging CSS together where sensible.

Obviously, on some pages you'll have multiple script src tags (e.g.,
google analytics or piwik, or functionality which is contained to a
single page/frame).  But as for the general rule, the production code
should be minified and delivered in a single file when possible.

    Just my 2¢,
    Mike

-- 
Naunet Corporation Logo 	Michael B. Trausch

President, *Naunet Corporation*
? (678) 287-0693 x130 or (888) 494-5810 x130

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130724/358d65ab/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbejbfii.png
Type: image/png
Size: 1701 bytes
Desc: not available
URL: <http://mail.ale.org/pipermail/ale/attachments/20130724/358d65ab/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://mail.ale.org/pipermail/ale/attachments/20130724/358d65ab/attachment-0001.sig>


More information about the Ale mailing list