Throwing it out here that you might want to use http://drupal.org/project/advagg/ as the base for this module. Let me know if you need any help with the API

Comments

sinasalek’s picture

I tried your module quite some time ago but it made Drupal noticeably slow, after that i stopped using it. So i'm not sure it it's the best approach.
Also what do you mean using it as the base of this module? I hadn't found any api documentation

mikeytown2’s picture

6.x AdvAgg has some hooks. The advagg.module file has ok documentation on them in the code; you are correct that the 6.x branch is lacking in published documentation.

hook_advagg_css_pre_alter() - give installed modules a chance to modify the data in the $css array if necessary.
hook_advagg_css_inline_alter() - give installed modules a chance to modify the contents of the inline css if necessary.
hook_advagg_css_alter() - give installed modules a chance to modify the data in the aggregate if necessary.

hook_advagg_js_pre_alter() - give installed modules a chance to modify the data in the $javascript array if necessary.
hook_advagg_js_header_footer_alter() - give installed modules a chance to modify the data in the header and footer JS if necessary.
hook_advagg_js_inline_alter() - give installed modules a chance to modify the contents of the inline javascript if necessary.
hook_advagg_js_alter() - give installed modules a chance to modify the data in the aggregate if necessary.

I'm guessing the slowdown was due to the usage of CSS & JS compression; try just the base module. I also believe most of the performance issues have been fixed in the 6.x & 7.x branches. For 6.x the biggest improvement that advagg has in comparison to core is that core's aggregates can be 404-ed due to the way the cache clearing happens.

almamun’s picture

@sinasalek, I also used advagg, tried latest version (of 7) and left it for the same reason. Please continue with your project.

sinasalek’s picture

@almamun thanks for the info, advagg is an excellent module, too bad that it suffers performance issues :(

@mikeytown2 I'm not sure if you know this but this module offers more features than drupal_add_js and drupal_add_css functions (specially on drupal 6) offer, therefore it has its own rendering process. If advagg also has its own rendering system making this modules work together will be tricky.
Any idea?

mikeytown2’s picture

@almamun
If you can pinpoint the performance issues I would like to try and solve them.

@sinasalek
You shouldn't need to do anything special if you're using hook_js_alter & hook_css_alter in D7.

D6 is a different story. Not using css_js_total_control_processor if advagg is installed and having css_js_total_control_advagg_js_pre_alter() (hook_advagg_js_pre_alter) call css_js_total_control_js_alter() (hook_js_alter) and css_js_total_control_advagg_css_pre_alter() (hook_advagg_css_pre_alter) call css_js_total_control_css_alter() (hook_css_alter).