Code Compressors

What are they? What do they do?

What is Gzip? What is Minify?



Yeah…thanks a lot. Thing is…I have already. And I’ve gone to both websites.

And I still don’t understand. (Sorry?) So can you help me instead of giving me stuff that I’ve already done?


If you’ve read all that information, then hopefully you’d have more specific questions. Right now, your questions are so general, that the most appropriate answers are the first paragraph of the respective wikipedia pages.

Gzip is any of several software applications used for file compression and decompression. The term usually refers to the GNU Project’s implementation, “gzip” standing for GNU zip. It is based on the DEFLATE algorithm, which is a combination of Lempel-Ziv (LZ77) and Huffman coding. The program was created by Jean-Loup Gailly and Mark Adler as a free software replacement for the compress program used in early Unix systems, and intended for use by the Project. Version 0.1 was first publicly released on October 30, 1992, and version 1.0 followed in February 1993.[citation needed]
OpenBSD’s version of gzip is actually the compress program, to which support for the gzip format was added in OpenBSD 3.4. The “g” in this specific version stands for gratis.[2]
FreeBSD, DragonFlyBSD, and NetBSD use a BSD-licensed implementation instead of the GNU version; it is actually a command-line interface for zlib intended to be compatible with the GNU implementation’s options.[3] These implementations originally come from NetBSD, and supports decompression of bzip2 and Unix pack(1) format.

Huh. That did more to confuse me than help :confused:

From what I can glean, gzip is just a regular file format used on local machines. So how does it apply to the web?

I also looked up Minify (earlier, I might add) and got to the Google Code homepage. It’s a ‘PHP5’ app…what exactly is a PHP5 app? Does that mean it’s done on the server? Can I compress code on my own personal desktop?


For Gzip, from the wiki page:

…headers in HTTP/1.1 allow clients to optionally receive compressed HTTP responses and (less commonly) to send compressed requests.

Web servers can zip text – like HTML, CSS, JS, etc. – and the browser unzips it, so that a smaller file is sent over the wire.

For minify… I’m not sure how you ended up at a PHP app. The first result of the google search explains the general practice of minification. From the wiki page:

…the process of removing all unnecessary characters from source code, without changing its functionality… Minified source code is especially useful for interpreted languages deployed and transmitted on the Internet (such as JavaScript), because it reduces the amount of data that needs to be transferred.

I’m sorry, but you’re being really unhelpful. I can read the Wiki page - that doesn’t mean I know what it means. Can you explain it in some way? How does it zip it? Through a program on the server-side? From what I upload through my FTP client?

And for Minify…the first result for searching ‘Minify’ leads to the Google Code page (that I specifically referenced) where it explains, in the second line (and I quote)

I can read, am self-sufficient, and know fully well the power of Google and Wikipedia. I’m just not well-learned in the field of code compressors. If you are, I’d greatly appreciate it if you could help me out.


The web server performs the compression on the fly. That web server could be Apache, IIS, nginx, etc. The specific process to enable compression is different for each server. In Apache, it’s done with the mod_deflate module.

You’re almost certainly looking for info about the general process of minification – stripping out whitespace and comments, and sometimes munging the code in other, more complicated ways – in order to reduce it’s size.

For a long time, the YUI compressor was the de facto standard for minification. Today, [url=]Google’s Closure Compiler has largely superseded it.

So the Minify page that I was referencing is a plug-in that I can upload to my server. That program does it on the fly (as per request).

I just downloaded Google’s Closure Compiler…that will do it on my own computer, right?


That will let you run the compiler from the command line or a script. You’ll of course need to read the compiler documentation to find out what command line switches you’ll want to use.

Gosh dang it. I hate command-line programs :frowning:

But thanks.

As you read through Closure Compiler’s documentation, you’ll discover the online app: