See my previous email. You don't want the browser to load a new JS file each
time. That would be silly if they've already got it. 

-----Original Message-----
From: Jim Rising [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 11, 2007 2:31 PM
To: CF-Talk
Subject: RE: too many js libraries

Yeah... That was the first approach I thought of, but didn't think it was as
elegant. ;)

The other thing that I was thinking about is that the number of potential
I/O accesses involved in that as the browser rips through all of the
included javascript src.

Why not just append a UUID or random number to the end? Won't that force the
browser to load a fresh copy of the javascript source?

<script type="text/javascript" src="javascript.cfm?#CreateUUID()#"></script>

And for extra measure... Expire the content on the server?

Jim Rising
Sr. Cold Fusion Developer
ICGLink Inc.
www.icglink.com

-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 1:47 PM
To: CF-Talk
Subject: RE: too many js libraries

Would probably be better to include javascript.cfm, which then writes each
individual script tag to the page. Otherwise the browser is only going to
try and cache javascript.cfm. 

-----Original Message-----
From: Jim Rising [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 1:16 PM
To: CF-Talk
Subject: RE: too many js libraries

Yeah I know... But I still like how mootools allows the developer to
download only those portions of the library that they need for the parts
that they are actually using into a tidy little compressed package. :) the
core is under 3k. The core + all elements needed for a javascript accordian
~20k.

It's sort of the same problem... If you are including the entire javascript
library and not just the components of the library that you're actually
using... Fixing that on the front end is one way to reduce your overall page
weight. (which is what it looks like Mike is trying to do)

If I was to try and solve the problem on the other end (after the site was
developed), I would first identify all the javascript objects that were in
use, and where they were being used within the application. No idea on the
best approach for this... Seems like a manual search. Once I had them all
inventoried, I would build a single 'javascript.cfm' file that consists of
conditional logic wrapped around javascript, where the conditions identified
specific javascript functionality given by javascript objects. At the top of
every page, I would put a <cfparam name="jObjects"
default="accordian,XMLHttpRequest,autocomplete"> (where the default values
are the objects that I want included on that page).

After all of this was done, I would include the javascript.cfm like this:

<script type="text/javascript" src="javascript.cfm"></script>

Of course I don't know how well this deals with browser caching issues... 

Jim Rising
Sr. Cold Fusion Developer
ICGLink Inc.
www.icglink.com






-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 11:49 AM
To: CF-Talk
Subject: RE: too many js libraries

He's talking about downloading the code in production to the client
computer. You're talking about a "build" for the developer Jim. 

-----Original Message-----
From: Jim Rising [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 11:06 AM
To: CF-Talk
Subject: RE: too many js libraries

I like mootools' approach... They have a downloader that allows you to
download only what you need:

http://www.mootools.net/download

Jim Rising
Sr. Cold Fusion Developer
ICGLink Inc.
www.icglink.com


-----Original Message-----
From: Michael Traher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 10:26 AM
To: CF-Talk
Subject: too many js libraries

Hi All, We have developed a large new website and used a number of
javascript libraries along the way for some effects and some ajax stuff.

I have a feeling that we are only using a tiny proportion of these
libraries, but they are being downloaded in full.

My question is how to find out what functions are in use across the entire
code base?

Anyone had to do this kind of optimisation process?

Any tips or tools that might help?

(I am already compressing the files in IIS6)

Cheers

--
Mike T
Blog http://www.socialpoints.com/














~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283501
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to