Author Topic: Minify  (Read 1894 times)

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Minify
« on: January 18, 2012, 10:29:37 PM »
How many of you guys actually go through the process of minifying your code?  Things like CSS/JS, etc?  I mean I use the minified version of jQuery, but I never really played much with reducing CSS.  My IDE has a tool to do it so I did it for shits and giggles on a file.  It took an 18Kb file down to a 13Kb file.  Probably not even worth it for the most part these days, but I could probably gain... 17Kb just in reducing my CSS if I did this.  Then again, I don't use all of those either, at least not on the same page, and that shit gets cached... so it's probably not worth the hassle.

I'm just curious if anyone else does it?  You'd almost have to keep 2 versions... the working version for editing and the minified version for production?

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: Minify
« Reply #1 on: January 18, 2012, 10:34:24 PM »
I can honestly say I have never done that.  Ever.
 :love:

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Minify
« Reply #2 on: January 18, 2012, 10:36:15 PM »
I've looked at it but (IMO) it isn't worth the hassle most of the time.  Sure, if you are trying to save bits go for it.  But we pass almost everything through mod_deflate anyways so I doubt there would be much change on the bandwidth side.

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: Minify
« Reply #3 on: January 19, 2012, 07:42:57 AM »
I've used it for a few sites that call in lots of resources but that need to be efficiant.  For example the site i just posted in safe contact... the version going to the client has minified js.  It only reduces the filesize of all the scripts from a total of like 120kb to 100kb which isnt very significant but it reduces the number of server requests by 5 or 6 files. Again a minor difference when the page has 100 assets but every bit helps.

Its pretty easy to do (i use jcompress) and cant hurt. Only downside is making changes requures repackaging the scripts.
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Minify
« Reply #4 on: January 19, 2012, 02:45:17 PM »
Grails has a plugin that we use that does all of that for us during packaging without having to worry changing any code. It's neat. I did it at my old place too manually but we just kept two files around.

Doing things like changing to CDN urls (like images.domain.com) can help if you have lots of static resources.
This signature intentionally left blank.