optimal way to remove unwanted js and css files from page I use drupal 6 and ubercart2. Loading of cart and checkout page takes a while so I am thinking about removing any js and css files which are not used on specific pages.
What would be the ideal way to do it? I know about js agregation but want to try the first approach.
Thank you very much.
The AdvAgg module can do this fairly easily. Syntax for this is different between 6.x &amp; 7.x. This is the hook syntax for 6.x. Works very similar to hook_css_alter() &amp; hook_js_alter() in Drupal 7. Using these hooks is how to do it in D7 BTW.

hook_advagg_css_pre_alter(&amp;$css, $preprocess_css, $public_downloads) {
  // Remove css files.
}
hook_advagg_js_pre_alter(&amp;$js, $preprocess_js, $public_downloads) {
  // Remove js files.
}