Javascript Minification

Posted by on November 30, 2011 in Javascript, Programming, Web Servers | 0 comments

Javascript is an interpreted language, meaning it’s not pre-compiled.  This has a few drawbacks, like keeping coding logic secret, but it’s good for quick changes and building scripts on the fly using another language.  Compiling is meant to speed up execution.  There is something you can do to speed up execution.  It’s called minification.  It does nothing but make your existing script take up the least amount of space possible.

What it does

  • Speeds up execution of the script slightly.
  • Reducing the physical size of the file.
  • Reduces bandwidth/http requests from the client when you combine scripts.

How it does it

  • Removes all linebreaks and white space
  • Removes all comments
  • Renames variables to shorter names.
You can minify code yourself, but why spend the time when there are tools out there that do it for you.  One great example is
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment

Your email address will not be published. Required fields are marked *