[wp-trac] [WordPress Trac] #57548: Stop concatenating scripts and stylesheets in wp-admin and retire load-scripts.php and load-styles.php

WordPress Trac noreply at wordpress.org
Thu Sep 4 10:28:44 UTC 2025


#57548: Stop concatenating scripts and stylesheets in wp-admin and retire load-
scripts.php and load-styles.php
---------------------------+--------------------------
 Reporter:  azaozz         |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  6.9
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  performance
---------------------------+--------------------------
Changes (by sergiomdgomes):

 * focuses:   => performance


Comment:

 Thank you, @jonsurrell!

 Sorry for not joining the discussion earlier, but I'd like to add a few
 comments inline now that I'm here :)

 > Browser module loading - can we stop bundling yet?

 I just wanted to add a note that my article is really old, and most of the
 findings may no longer apply. Still, it mentions the sort of issues one
 can reasonably expect.

 In general, I haven't seen conclusive evidence that concatenation no
 longer has a benefit.

 As @peterwilsoncc mentions, the "small files" compression problem is still
 relevant, and there isn't a cross-browser solution to address it. Even
 though WordPress doesn't handle compression itself (whether gzip or
 brotli), the expectation is that a competent host will enable it at the
 HTTP server level, and that it will have a meaningful impact on
 performance, so it's something we do need to consider.

 > The additional latency required to boot up PHP to concatenate the
 scripts should be considered as well. Serving static files would be a much
 faster TTFB.

 This would be good to test, but we have to remember that the WordPress
 ecosystem is extremely heterogenous, and it's difficult to make broad
 assertions that are valid everywhere.

 In this case, since we're thinking outside of WordPress and at the level
 of serving infrastructure, we have to consider the impact of edge caches
 as well. It's reasonable to assume that the concatenated files would also
 be edge cached, potentially negating the effect of any boot-up cost in
 concatenation at scale.

 > We can get some additional benefits by preloading key scripts and styles
 used on in the editor when the user lands on the dashboard, for example.

 Preloading is a rather forceful technique that should be used with extreme
 caution, as it has the potential to make things worse. It's generally
 preferable to leave prioritisation to the browser, and at most provide
 hints in the form of `fetchpriority` or by rearranging things so that the
 resource is discovered earlier.

 In any case, if there is any benefit to be had here, it may be worth
 exploring independently of concatenation.


 ----

 Don't get me wrong, there are definitely some downsides to concatenation.
 Beyond the security issues mentioned, it makes debugging harder, and it
 can worsen problems with scripts, in that script-breaking bugs now break
 all the concatenated scripts, not just the one script.

 But in terms of performance, the evidence I've seen so far is that there's
 still an improvement.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57548#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list