Drupal 7 css and js compression When I turn on Drupal 7 css and js compression in the performance part, it is aggregating too much files.(5 css files and 5js files). Why?

The page:


Is there any way to force drupal to aggregate more the files?
No, not really, and you wouldn't want to do this.

The thing is, Drupal aggregates CSS files into groups to be able to easily load different CSS sets for different 'media' and 'browser' values, as well as for different pages being viewed, without the need to regenerate them.

If you look into $groups variable generated by drupal_group_css() in includes/common.inc, there are 5 keys which different combination of values between each group: type, every_page, media, preprocess and browsers.

This allows for different groups to be loaded on different pages/in different situations without regenerating them (or including not-needed CSS), which would be the case if only one aggregated CSS file would exist.