Make WordPress Core

Opened 13 months ago

Last modified 8 months ago

#59301 new enhancement

Incorporate script loading strategies in WP Admin to improve performance where applicable

Reported by: westonruter's profile westonruter Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 6.3
Component: Administration Keywords:
Focuses: javascript, performance Cc:

Description

As of #12009 the script loader now has the ability for scripts to be printed with async or defer. This is being used on the frontend now for block view scripts (#59115), the comment-reply script (#58870), and the wp-embed script (#58931). Nevertheless, these new script loading strategies are not currently being used in the admin. There may be opportunities to improve performance by doing so.

Typically only jquery-core, jquery-migrate, and utils (less frequently moxiejs and plupload, and even less frequently wp-polyfill-inert, regenerator-runtime, wp-polyfill, wp-hooks, zxcvbn-async, wp-codemirror, and underscore) are loaded in the head in the admin; furthermore, these scripts are concatenated together via load-scripts.php. For backwards-compatibility, these scripts might not be able to be delayed or moved to the footer. In other cases, there may be existing footer scripts that could be moved to the head and made to load with defer: this would ensure that they start loading sooner so that they can execute as soon as the document finishes loading. Other scripts could potentially be lazy-loaded only when needed (e.g. zxcvbn).

Note that the block/site editor screens will benefit the most from block lazy loading.

Change History (3)

This ticket was mentioned in Slack in #core-performance by joemcgill. View the logs.


11 months ago

#2 follow-up: @tabrisrp
8 months ago

Is there already some steps that were discussed for this?

#3 in reply to: ↑ 2 @westonruter
8 months ago

Replying to tabrisrp:

Is there already some steps that were discussed for this?

Steps in what way? Like specific scenarios which were identified in the admin where async/defer scripts would improve performance? No.

Note: See TracTickets for help on using tickets.