I am trying to use AdvAgg in my Drupal 7 site. I am using a local server for running tests.

The issue is that the module doesn't compress (php-jsmin) all the JavaScript files, which is causing a bad score in page speed insights.

After some debugging, I found out the problem: The uncompressed file didn't have a compress ratio between 0.1 and 0.9 so it was being aggregated as it was.

I'm talking exactly about advagg_js_compress.module file, lines below 143:

// Set to "-2" if compression ratio sucks (it's already compressed)

Why is necessary a min ratio? Could set min ratio to 0 so that all JavaScript files are processed?

1 Answer 1


Sometimes things compress too well; ie empty string. Sometimes things don't compress at all; ie already compressed. In both cases I opt to use the original file since minification of already minified js can sometimes cause js errors. You can variable set it if you want to adjust the min/max cutoff.

  • Ok Mikeytown2, thanks. As far as I can see jsmin should't leave the string empty in any case... Anyway, I will adjust min ratio to 0. I think I contacted you on G+. Better this way, I guess… I'm "playing" with the module and I found some issues I want to correct. I will write here in case I find it necessary. Thanks again!
    – José L.
    Commented Dec 7, 2014 at 10:52
  • 2
    The module issue queue is the best place to contact me in regards to a specific module.
    – mikeytown2
    Commented Dec 7, 2014 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.