Minification is not a new idea. I've found it tends to get used in Java and .Net apps more just because they already have a build process--something that doesn't normally occur with PHP applications. The excellent and well-regarded YUI Compressor is a Java program that is designed to be used as a command line tool, typically in a build process.
There is good reason for this attitude: good minification can be a relatively expensive operation. It's not something you'd want to necessarily do every request.
Some might question the need for minification at all if the output is already gzipped. While it is true that gzipping will do some of the job of reducing the payload size, good minification will go beyond that to renaming variables and possibly even rewriting code sections that could be shortened.
Popular libraries like jQuery and plugins often come in a pre-minified form. It's fine to use these but you'll still need to minify the scripts you write. I prefer to use the unpacked/unminified versions for debugging purposes. It's easy to change a script such as this one to minify or not depending on the environment, the user or some other setting.
Our script then becomes:
This is, of course, concatenating and minifying on every request. We should remedy that next.