Click to See Complete Forum and Search --> : [RESOLVED] js libraries size


dougal85
01-03-2007, 10:08 PM
I was wondering...

If site A uses a javascript library (there is so many so i wont even both picking one)

then website b uses the same library.

if somebody goes to site a and downloads all the .js will they need to download it again when they go to site b?

I'm assuming they will.

The reason I'm thinking about this is i'm concerned about a project that I'm working on. as its using the script.aculo.us library, there is about a 240 kb overhead of just javascript.

dougal85
01-03-2007, 10:13 PM
I ran the code through this tool, a javascript/css compressor : http://www.creativyst.com/Prod/3/

It's pretty handy... it knocked almost 100 kb's off the size of the javascript.

However, it still feels fairly bloated...

JPnyc
01-04-2007, 12:32 AM
js files are cached like any other content.

Weedpacket
01-04-2007, 05:55 AM
And for reasons of security URL integrity, cached files are keyed by URL - different URL, different cache file.

dougal85
01-04-2007, 09:07 AM
i thought as much, but i had hoped.

maybe somebody should develope a js library that can be installed... a bit like flash... or if adobe included one inside something like flash everybody would have it very quickly.

*dreaming again*

JPnyc
01-04-2007, 10:00 AM
Well the problem being that it's not analagous to Flash. When you download flash you're downloading the interpreting engine, not a script library, however where JS is concerned, your browser already has it. The best friend we have where this is concerned is writing extremely efficient code.

dougal85
01-04-2007, 10:44 AM
Indeed, but I'm no javascript programmer so i use a library thats already out there.

I was just using flash as an example of something that widely distributed.