This is a very good module to improve performance, my Drupal website got an "A" on "Make fewer HTTP requests" YSlow starting from an "F". :-)

Since a big JS file is generated, can you implement a JS minifier to reduce the file size? Minification on a per-module basis is quite difficult, but with a single big file is possibile. You can add an options like "strip comments" to leave user freedom to minify.

Here some open questions that minification can solve:

Comments

derjochenmeyer’s picture

Status: Active » Postponed (maintainer needs more info)

I did some research on this, but i didnt find a save way to do it.

Winm Leers also pointed out this issue http://drupal.org/node/210447

Its seems that the js aggregation which is built into drupal6 is not using file compression on js files because too many unsolvable problems occurred.

If you have a save approach, contribbutions are welcome. :)

chirale’s picture

Status: Postponed (maintainer needs more info) » Active

I read a good introduction to this topic on the The JavaScript Minifier (JSMIN) page by Douglas Crockford.

Code to be minified should satisfy some requisites like:

Do not put raw control characters inside a quoted string. That is an extremely bad practice. Use \xhh notation instead. JSMin will replace control characters with spaces or linefeeds.

Use parens with confusing sequences of + or -.
[...]

So you've to check the code before minify it, or you get errors.

PHP code of minifier is available here, but it's released under a MIT license. Are there some GPLed alternatives?

From what i seen, a minifier with this module should:

  1. Aggregate the big, not minified file
  2. Check and sanitize file code to avoid JS corruption
  3. Run a minifier on sanitized file
  4. Cache it
derjochenmeyer’s picture

Status: Active » Postponed (maintainer needs more info)

Hi chirale, the problem with the licence could be solved as with other non GPL components. That an advanced user adds the libary manually. A README file can provide instructions.

The problem with jsmin for php is that it requires PHP5+

I think that narrows down the circle of possible users :(

derjochenmeyer’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Marking this as a won't fix, since its not the main focus of this module and it seems problems cannot be solved for the majority of users.