[wp-trac] [WordPress Trac] #59599: Possible performance regression: script strategy `defer` with dependent in footer

WordPress Trac noreply at wordpress.org
Fri Oct 13 18:44:27 UTC 2023


#59599: Possible performance regression: script strategy `defer` with dependent in
footer
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:
                                                 |  westonruter
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.4
Component:  Script Loader                        |     Version:  6.3
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  dev-feedback has-patch has-unit-     |     Focuses:
  tests commit                                   |  performance
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56933" 56933]:
 {{{
 #!CommitTicketReference repository="" revision="56933"
 Script Loader: Move delayed head script to footer when there is a blocking
 footer dependent.

 This prevents a performance regression when a blocking script is enqueued
 in the footer which depends on a delayed script in the `head` (with
 `async` or `defer`). In order to preserve the execution order, a delayed
 dependency must fall back to blocking when there is a blocking dependent.
 But since it was originally delayed (and thus executes similarly to a
 footer script), it does not need to be in the head and can be moved to the
 footer. This prevents blocking the critical rendering path.

 Props adamsilverstein, westonruter, flixos90.
 Fixes #59599.
 See #12009.
 }}}

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


More information about the wp-trac mailing list