Drupal 8 can concatenate assets like CSS and JS. This can greatly reduce the amount of HTTP request. But with HTTP2 the overhead of an HTTP request is now very low and concatenation seem useless and can degrade performances.

Perhaps the first step would be to create a notice in admin/reports/status if you a in HTTP2 and use bandwidth optimization for assets.

There is a lot to explore like server push and content prioritization. Peoples have to understand that HTTP2 turn best practices upside down.

Comments

gagarine created an issue. See original summary.

nod_’s picture

We need to check some data first. While theory is great, we can't dismiss real life :)

We have a lot of files (like 50+ js files for admin users). Also for CSS when not aggregated we use @import which had (and probably still has) it's own performance problems so we'd need to change that too.

gagarine’s picture

I Agree of course we have to do real test.

If I remember right the "@import" was because of an old version of IE that has some kind of limit with the numbers of included files.

EDIT: yep that's it https://support.microsoft.com/en-us/help/262161/a-webpage-that-uses-css-... not sure it still applied to more recent version of IE.

Wim Leers’s picture

Status: Active » Postponed
Issue tags: +HTTP/2

At the moment, this is not remotely true yet, sadly. Plenty of evidence around that shows that fetching dozens of CSS or JS files via HTTP/2 is still slower than aggregating them into a few…

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Status: Postponed » Postponed (maintainer needs more info)

Moving to needs more info. There's also the issue that aggregation and minification are linked.

On top of this, the sheer number of elements that CSS and JavaScript would add to a page would increase the amount of HTML to download and parse - it could be hundreds.

I think we'd be better off looking at #2554051: Use the asset library dependency tree to improve CssCollectionGrouper & JsCollectionGrouper and revisiting this only after that issue is resolved.

Wim Leers’s picture

Title: Disable "Bandwidth Optimization" when serving with HTTP2 » [PP-1] Disable "Bandwidth Optimization" when serving with HTTP2
Status: Postponed (maintainer needs more info) » Postponed

+1!

The general advice on the web as well as 99% of articles on this subject do not apply to Drupal, because Drupal is extremely modular, with each Drupal module able to add 1 or more CSS/JS files, and potentially hundreds of installed modules… resulting in indeed hundreds of CSS or JS files, with each one tiny.

I have yet to see any data at all on how hundreds of tiny CSS/JS files would impact front-end performance on HTTP/2.

But given that each even for far fewer and far larger files, it wasn’t even feasible stopping bundling and relying entirely on H2 until at least a few years ago, it seems unlikely the increase in overhead could ever be sufficiently compensated 😅

(The only way that could IMHO conceivably happen is if at least we let asset-library-level bundling. That would then also result in a nice simplification of the asset handling logic. But … on its own that’s probably not worth it either. And it likely still results in a performance regression.)

KlemenDEV’s picture

There is the ADVAGG bunder module where one can set a number of files it is aggregated to, meaning one can set it to eg. 15 files which is good trade-off for HTTP2. I think something similar in core would be very beneficial.