cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Huttar <>
Subject using Cocoon for on-the-fly minification?
Date Fri, 04 Sep 2009 17:30:22 GMT

Has anyone successfully configured Cocoon to do on-the-fly minification
of js and/or CSS?
There are good java-based minifiers out there, such as Dojo ShrinkSafe
and YUI Compressor.

Both use Rhino, which Cocoon ships with, I believe.

The YUI compressor page says,
"If you wish to minify your files on the backend (also known as
on-the-fly minification) instead of at build time, you will want to
cache the minified files in memory for optimal performance (instead of
minifying the same files over and over & minification is a time
consuming process) Note that the YUI Compressor can easily be
instantiated and used from a Java-based environment (Servlet)."

This page:
talks about a guy who "used cocoon and the yui compressor to concatenate
and minify the js and css files, something that greatly reduced the
number of http requests. It also gave us the freedom to write well
documented code and sep[a]rate the code into a large number of small files."

Those are some great benefits...
but how to integrate YUI compressor into Cocoon? Do I need to write a
custom generator? And how to provide caching?

Thanks for any ideas,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message