Hi Lars,

I've been working with Wilfred on that project, but I'm not really sure if I was the guy that wrote the component, which he talks about. However I have written something similar about 2 years ago.

The way I implemented it was by creating a reader. This reader then reads the js van the filesystem and minifies it on the fly. However this is quite nice, but it would be better if you could compress it on build time. Next to that the yui compressor comes with it's own version if rhino, which might conflict with the one that comes with Cocoon. I'll try to find some code example.

Regards,

Jeroen

Lars Huttar wrote:
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.
http://developer.yahoo.com/yui/compressor/
http://dojotoolkit.org/docs/shrinksafe

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: http://wnas.nl/how-to-redevelop-a-large-website
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: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to