treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Minified VS. Packed Javascript?

  • Hello,

    I've done a few google searches regarding minified and packed javascript files…but I've yet to find a clear answer/explanation defining the key differences between the two. Aside from the file size and appearance of the markup, can someone please clarify the differences?

    Thank You

  • Minifying and packing for the most part refer to the exact same thing: reducing amount of syntax to provide the shortest code possible. I guess packing was the term early on before minifying catched up as a better term, and I guess (early) packers didn't always do good job with code performance. Modern tools should be quite safe to use.

    Compression is a different thing though. It refers to serving the JavaScript files as a GZIP compressed stream. This is transparent between server and client: web server can be set to do the compression on-the-fly while browser automatically uncompresses when it receives compressed data.

    Thus you can get minimal transfer by first minifying a JavaScript file and then serving it compressed. And yes, the end result is often smaller than when only compressing with GZIP.

  • @merri

    Thank you for the information!