cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal Bhatt <>
Subject Re: using Cocoon for on-the-fly minification?
Date Tue, 08 Sep 2009 22:11:04 GMT
What you are talking about is a reader.

I created a cocoon 2.2  reader which minified JS scripts (using jsmin) 
but the view on the dev mailing list was debate if there was a real need 
for this and so I abandoned the project [1].  I agreed with Reinhard oin 
the end.  The basic argument against this was that it is more efficient 
to do this at build time.  If you are using cocoon 2.2, then you can use 
Maven, if you are using cocoon 2.1, it is a little more difficult, but 
can be achieved using Ant tasks.

Last time I looked at the YUI compressor and shrink safe, they weren't 
Cocoon friendly because both projects actually modify Rhino's code base  
without changing the package (though that might have changed).

Maybe the community should decide if this functionality is required.


> Hello,
> 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,
> Lars
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Kamal Bhatt

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

View raw message