CSS and JavaScript aggregation in Drupal 7
stefan:h ave you noticed that javascript and css aggregation does not work as expected on dgd7.org.
17:28 mlncn: how do you expect it to work? they changed it in D7, mostly for the better
17:28 stefan-agaric: there's 3 css and 2 js that seems to be created by it.
17:28 mlncn: there's more files, but they aren't recreated as often
17:28 stefan-agaric: what's the point?
17:29 mlncn: or rather, i should say, there's more files per page but fewer files when browsing around the site
17:29 stefan-agaric: we only need one.
17:31 mlncn: in D6 any little difference on the page (some module doing a drupal_add_css) would trigger a reroll of the file. now at least one of those aggregated CSS files probably applies to every page on the site
17:32 mlncn: the other excuse for multiple CSS aggregated files is something about respecting the order that the files are supposed to be in-- that i didn't follow so well, apparently it can be done better but it's hard
17:32 mlncn: and JS of course has top and bottom
17:34 mlncn: but, it's something that you can take over pretty completely with hook_css_alter()
17:34 mlncn: and hook_js_alter()
See also Definitive Guide to Drupal 7's Performance appendix and http://www.metaltoad.com/blog/drupal-7-taking-control-css-and-js-aggregation
Comments
Post new comment