I don’t use minify but i do compress the js by putting an index.php file in my template directory which regroup all the needed libs and gzip them.
Then in my template i load it automatically
//Loading the index file in my template directory <script type="text/javascript" src="[(base_url)]/assets/templates/mytemplates/libs/"></script>
I’m using ExtJS on front end and it reduce the size from 685kb to 135kb. If someone is interested, here a sample code:
<?php ob_start ("ob_gzhandler"); header("Content-type: text/javascript; charset: UTF-8"); header("Cache-Control: must-revalidate"); $offset = 60 * 60 ; // Duration in seconds before the cache expires $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; header($ExpStr); // Javascript files to compress include $_SERVER['DOCUMENT_ROOT'].'/assets/libs/extjs/adapter/ext/ext-base.js'; include $_SERVER['DOCUMENT_ROOT'].'/assets/libs/extjs/ext-all.js';
Now i don’t know if it’s possible to use this method in combination with MODx function getRegisteredClientScripts(), it could be useful.
Web Optimizer - http://www.web-optimizer.us/ - has a lot of auto optimization techniques. Very powerfull package.
Also it supports modx.
Just implemented Smart optimizer http://farhadi.ir/works/smartoptimizer
Works great, works with Modx.