Hacker News new | ask | show | jobs
by Zirro 5035 days ago
I don't think I've ever seen so many separate JavaScript and CSS-files used on a page before. Surely most, if not all, could be reduced into one?
3 comments

In Drupal any module can inject its own separate stylesheet into the page. It's standard practice to enable Drupal's CSS (and javascript) compression feature once you move the site to production. That they haven't done it suggests the developers aren't very familiar with Drupal, or easily overlook details.
Drupal 7 does this out of the box, with an option to aggregate and compress JS and CSS. I have not developed on Drupal 6 but would be incredibly surprised if there wasn't at least a community developed module to do this.
If I remember correctly this has been available out of the box at least since Drupal 5 up. Have worked on Drupal 5 and 6, don't remember using any custom module to do aggregation.
It's rarely beneficial to compress to one single file, but I completely agree that the way they are doing it it very inefficient, especially spamming the @import notation.
Not sure what you mean by "rarely beneficial to compress to one single file".

But in multiple situations I have seen significant web load performance improvements when the number of discrete files being loaded is reduced - merge all JS into one file, all CSS into another and sprite images. This is due to HTTP 2-connection rule.

And slow-start certainly contributes.