> If you look in our pom.xml, you'll see we have to bypass compression for
> several files because of yuicompressor's buggy output.
caja, opensocial-samplecontainer and syndicator ... for all intents and
purposes that shouldn't affect me since the PHP version doesn't caja at
all, and my current thought was to only compress things called
thru /js/libs:stuff.js and inlined javascript in the gadget, which
excludes both the sample container and syndicator.js that the mvn build
process does pick up, so i should be quite safe there :)
> How would you do this on the fly? Invoking yuicompressor, or using something
> less powerful?
Basicly (in semi-pseudo code) it would mean doing something like:
$out = tempnam('/tmp','compressout');
if (!$config['debug']) {
if (we can't retrieve the cached compressed version) {
@exec("java -jar {$path_to}/yuicompressor-2.2.5.jar -o $out
--type js
$feature_js_file");
if (($contents = file_get_contents($out))) {
// store in cache so we don't have to keep compressing each
request
}
}
}
ie, just invoke the yuicompressor if debug is false and the jsLibrary
type is inline , and cache the result of it (which would imply there's a
cached compressed and non compressed version, but since the size of the
features javascripts is quite limited this isn't a problem at all)
-- Chris