I'm testing this module and have run into a conundrum.

I can use jsminplus (the minifier coded in PHP) but my files take 0.1-1 second each to minify (except for jquery.min.js which takes 4s. When I use this minification, all is well on my site.

If I install the PHP extension using the C lib, the files take < 0.001 second each (less than one ms). However, when I do this, I get an error from the JS in the "context" module.

Now one could argue that the JS in the context module should be altered to not break minification from the PHP extension, but who knows if they would make that change. I'd rather not hack the JS myself, simply for reasons of ongoing maintenance/updates.

If this module offered a way to specify files that should ignore the minification, that would be a great way for me to work around this problem. I tried looking around in the module, but I can't find that implemented. Another reason why it might be nice to have such a feature would be for files that are already minified, so that they don't have to be run thru the minifier unnecessarily.

Thoughts?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Looks like there is an updated version of the C extension; I might end up pointing to this.
https://github.com/sqmk/pecl-jsmin

In the mean time it seems like having a way to specify this file should be compressed by X, this one by Y and ignore Z would be the way to go. I'll put it under a fieldset; use the same code for CSS as well.

brettbirschbach’s picture

Regarding updating the C extension - perhaps not a bad idea. The one you have referenced currently I pulled down, but it has a compile error when I try to build it on my mac (a non-void function with a plain "return;" statement). I had to fix the source in order to get it to build. When I built it on a different machine I didnt get the error, so I'm guessing some compilers are less picky. Had I not known what I was doing with jumping into the C code to fix my compile problem, I may have given up on that possibility prematurely, which is a shame since it is so very very very much faster than the straight PHP minifier.

mikeytown2’s picture

Following patch has been committed. Let me know if you've tested out the newer C extension.

mikeytown2’s picture

Status: Active » Fixed
mikeytown2’s picture

Following patch has been committed.

brettbirschbach’s picture

Wow, now that's a fast turnaround. Thanks mikey! I have not tested the new C lib - I simply tested with the one that you had referenced, and never looked beyond that.

mikeytown2’s picture

Title: Skip files for JS Compression » Skip files for JS & CSS Compression

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.