bostboy — 2011-01-21T12:15:14-05:00 — #1
Obviously I would at the very least like to strip out comments, etc. and would also like to minimize them as much as possible if that makes a performance difference. Any input is welcome at this point.
felgall — 2011-01-21T14:02:12-05:00 — #2
If you look at jQuery you will notice that they abandoned using Packer some time ago and now just use a minified version with the comments and surplus spaces stripped out.
bostboy — 2011-01-21T14:30:53-05:00 — #3
Thanks for the input. Not sure we're on the same page. I am talking about my js files that I'm wondering about my files that I am including as
I found a Minify routine that seems to work fine. Is it necessary to do more than that? The files aren't all that big, the largest is 20k that minifies to about 13k. Is it even worth worrying about?
The minify does remove all the comments, etc. which is nice.
felgall — 2011-01-21T19:09:40-05:00 — #4
Well that should help make your page load faster and so is worth doing.
The point I was trying to make is that minifying all your scripts is worthwhile. Trying to compress them using Packer or similar is not worthwhile because while doing that can make the file slightly smaller it means that there code that needs to run after the page has been downloaded to unpack the script back into code that can actually run.
Since most browsers and servers now support the downloading of gzipped versions of the files the actual amount of data to be sent from the server to the browser will be less than the original file size. So your minified js file may only actually need to send 8k to the browser in order to download the 13k script whereas if you used Packer the 20k script might compress down to 10k which then gzips to 9k to send to the browser and then still needs to beunpacked before it can be run (all file sizes are estimates and would vary depending on the actual content of the script but this should give you the general idea).
bostboy — 2011-01-21T20:22:56-05:00 — #5
Thank you so much. That makes it perfectly clear and was the exact input I was looking for. I really appreciate it.