User login

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

Searched words: 
why multiple files of Cascading Stylesheets and JavaScript in D7

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.