Make WordPress Core

Changes between Initial Version and Version 3 of Ticket #58870


Ignore:
Timestamp:
07/20/2023 08:18:42 PM (19 months ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58870

    • Property Keywords has-patch added
    • Property Owner set to westonruter
    • Property Status changed from new to accepted
  • Ticket #58870 – Description

    initial v3  
    33Adding either `defer` or `async` to the `comment-reply` script will cause the browser to treat it as low priority from a [https://web.dev/fetch-priority/#browser-priority-and-fetchpriority loading perspective]. However, in the case of `defer` it will still block other `defer` scripts and the `DOMContentLoaded` event. With `async` there is the possibility that the execution may be delayed until after the DOM loads if the script is not in the cache yet. On the other hand, if the `async` script is cached, it may execute right away which would be no different than the current situation of it being a blocking script in the footer: so no better or worse. But for the case where the `comment-reply` script is not cached yet, `async` would surely be better.
    44
    5 Additionally, according to [https://www.tunetheweb.com/about/ Barry Pollard] there is talk of executing all `defer` scripts together in one single task rather than running each in their own task. Using `async` would prevent adding another script to this `defer` group.
     5Additionally, according to [https://www.tunetheweb.com/about/ Barry Pollard]: "Current browsers ''may'' execute all `defer` scripts altogether in one single task (Chrome does). There is talk within the Chrome team as to whether these should run in their own tasks. Using `async` would prevent adding another script to this `defer` group."