moseleysc wrote:
QUOTE:
Hi there,
Yeah, I knew it was developed at acid drop. I've tried before to integrate it with Joomla 1.5, but I couldn't get it to work. I did a few other things that basically gave me enough "speed up" to not have to use PHP Speedy. I came back to look at it because of all the javascript files Community Builder spits out.
I've looked at the compressor file a little bit, and couldn't find where the compressed files are output - it is simply placing it in the head after the last occurance of a script or css file?
I have some projects that really need to get done, so I can't look at it too much, but I guess my idea for the future would be to see if PHP Speedy can return both the script and the css files in variables to the bot_speedy file, then you can add the files to the head with Joomla's addScript method, which puts it pretty high up in the head (and might avoid some of the problems with scripts referencing a library not yet loaded).
Just a thought.
Steve
The method compressor->compress() is doing the replacements. I think the problem is that it does not replace inline JS, and thus the JS execution order of inline and remote JS changes.
I've added the issue to the tracker:
http://code.google.com/p/joomla-php-speedy/issues/detail?id=2
I think the ways around it is to:
1) only compress JS files in between inline JS, and inset the compressed JS file back in the correct execution order. This would mean more then one cached JS file and more HTTP Requests - but less cache expiry.
or
2) to include inline JS into the compressed files. This would mean that any editing of the inline JS would make the cached JS file stale/expire and trigger a recreation of the cache.