This causes a very large number of CSS caches to be generated (one for every used combination of files, which is a lot!) and resend the same CSS code again and again, wasting bandwidth and breaking caching.
Instead, CSS should either:
a) Be loaded conditionally, but have $preprocess set to FALSE. This is appropriate for Admin or other "rare" CSS.
b) Be loaded on every page (yes, even if unneccessary for that actual page), and leave $preprocess set to TRUE. This is appropriate for CSS that you would expect an average visitor to need during a typical visit.
Obviously if we are going to use a split of these techniques for different files we will need more of a refactoring of the code (since type (b) should be added in hook_menu), but for the time being the attached patch fixes the immediate problem by simply setting $preprocess to FALSE.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 359132_css_preprocess.patch | 865 bytes | owen barton |
| css_preprocess.patch | 860 bytes | owen barton |
Comments
Comment #1
owen barton commentedNULL != defaults. It's late...
Comment #2
merlinofchaos commentedCommitted. Thanks!