Matt Curry has written a CakePHP plugin to automatically compress CSS and Javascript files in CakePHP. It requires nearly no modification of existing code and works as you would expect it to. Except when you need themes.

If you choose to use the 'Theme' view in CakePHP, that plugin will happily disregard it and load the regular files instead of the themed files. I wrote a patch to fix the behavior.