On-the-fly CSS Compression Script in PHP
Web site optimization experts suggest that webmasters try to minimize the number and size of HTTP requests necessary to serve web pages. Web designers often use multiple CSS files because they are easier to manage, but this requires as many HTTP requests as there are CSS files.
This script will allow you to serve all your CSS files as a single HTTP resource, minified (by removing comments and extraneous whitespace), and gzip- compressed. It also requests browsers to cache the CSS content for at least a day before trying to fetch a new version.
Use the Script on Your Server
The best part is that this does not pre-process the files, so it does not add any steps to your deployment process. It’s licensed free for commercial and non-commercial use, with attribution requested.