[development] Poll about a new module messing up with JS and CSS aggregation
Pierre Rineau
pierre.rineau at makina-corpus.com
Thu Jan 6 10:54:11 UTC 2011
Hello all,
I did a small D7 module that allows site administrators to play with JS
and CSS aggregation.
It allows site admin to select which files (CSS and JS) among libraries
and arbitrary added module files should be aggregated in all pages, thus
making the aggregation predictable. The goal of this is to make single
JS and CSS files for sites, the same for each page, in order to maximize
client cache hit so save bandwidth.
This is done by forcing Drupal core to aggregate selected files either
at hook_init() time, either at hook_(css|js)_alter() time, and by
messing up with aggregation groups and weights.
Methodology of this module is quite simple, and I actually use it on a
production site and have no side effects for the moment.
The best result I could have right now is:
- Only two JS files for the full site (all JS libraires, + Drupal.t
specific file), against at least three using normal aggregation,
different on a per-page basis using the core.
- Only two CSS files (all CSS (system and other) libraries + theme
specific file), against at least 3 to 4 using normal aggregation,
different on a per-page basis using the core.
- A glitch (a CSS files with a if <!--[ 1]--> which seems to be a bug
^^)
One of its future features will be JS on the fly minification (or using
a batch maybe).
I wonder if people are interested by such module, if so, I would be
pleased to commit it as a new project on drupal.org, if not, I just
won't I don't want to pollute the community site module list.
You can take a look in my sandbox there:
http://drupalcode.org/viewvc/drupal/contributions/sandbox/pounard/core_library
Pierre.
More information about the development
mailing list