Scriptaculous 1.7 Compressed


Jimminy Cricket. The updates just keep on coming. It's getting a little bit difficult to keep up.

Prototype 1.5 was finally released not too long ago, and on the 19th, Scriptaculous followed suit. In keeping up with my release of compressed versions of these files, here we go.

I have three different downloads, choose the one appropriate for you:

LinkOriginalSizeGzippedSavings
Prototype and Scriptaculous180K71K31K34 Seconds
Prototype and Scriptaculous - just Builder and Effects112K47K22K20 Seconds
Scriptaculous all by itself110K43K20K20 Seconds

I calculated the time savings based on an average dialup download speed of 4.392K / second. This isn't everybody, and it might not even be a lot of your users, but across all the sites I've managed, I've seen consistently 20-25% of visitors to be dialup visitors. For those people, a file size difference between 180K and 34K is astonishing.

Honestly, I haven't had any testing time with this set yet - since it's been 5 days since the release, I wanted to get this software available for download quickly. I didn't notice the release until somebody posted a comment about it. I used my standard methodology which has worked well in the past.

collapsehide line numbers
Sample Code
 1<br />
 2cat ../lib/prototype.js builder.js effects.js dragdrop.js controls.js slider.js > sc-combo-w-proto.js<br />
 3jscompact -pnal <sc-combo-w-proto.js > sc-combo-w-proto-compact.js<br />
 4jspacker -i sc-combo-w-proto-compact.js -o sc-17-proto-15-compressed.js -f -e 62<br />
 5vi sc-17-proto-15-compressed.js "then insert copyright, :wq"<br />
Code ©SteveKallestad.com

jscompact does a little bit of cleanup, things like whitespace. The -pnal options has it output "pretty" formatting, keep newlines, and leave variable names alone. Not a lot of compression at this stage, but the output is good for jspacker 9 times out of 10 without having to do any manual editing myself. There have been 3 instances in the past where either Scriptaculous or Prototype would not result in working compression without first being run through jscompact. This probably won't always be the case, and it might not be the case right now, but it works, it doesn't increase file size, and it's a very minor change to my process.

jspacker does most of the dirty work. The -f flag is used to include a fast decompression function which increases file size slightly, but helps the end user experience significantly. the -e 62 is telling it to use Normal encoding - which is the most appropriate and safest in my experience.



Scriptaculous 1.7 Compressed Feedback