Right now both drupal_build_css_cache() and drupal_build_js_cache() will generate a bundle key based on the whole $css and $files array. On different pages however the filelists could be different but after the drupal_sort_css_js() it could turn out that several groups would be nearly identical to those on other pages, with one difference: weight being a bit less or a bit more on certain items. This will result in generating the very same bundle yet again under a different key.

I think we can do several things. I think the simplest (and probably the most unpopular) would be basing the bundle key solely on the filenames. Or we could rip out the weight after running the sorting function. Other ideas ?

Comments

bleen’s picture

but ... but ... but....

Isn't the weight REALLY important here? The whole "cascading" thing depends on the order in which the CSS definitions are output.

What am I missing here?

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.