Make WordPress Core

Opened 12 months ago

Last modified 7 months ago

#58801 assigned enhancement

Prefetch Block Editor from Posts page

Reported by: adamsilverstein's profile adamsilverstein Owned by: adamsilverstein's profile adamsilverstein
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Editor Keywords: dev-feedback needs-unit-tests needs-testing has-patch
Focuses: performance Cc:


One of the most common user journeys in wp-admin for creating or editing a Post is navigating to the Posts page (wp-admin/edit.php) then to the Block Editor (either by clicking a post to edit or clicking the "New Post" button or sidebar menu).

We can greatly increase up the speed with which the editor loads by prefetching the edit screen once the user reaches the Posts page. Prefetch will "prime the html cache" for all of the resources needed by the editor, resulting in the editor loading much faster for users.

Note: since users can also reach the editor from the wp-admin bar, we might want to consider adding prefetch when the user interacts or opens the "New" menu. However, to keep this initial proposal small and easier to test I decided to limit the scope to the Posts page.

Attachments (1)

58801.diff (420 bytes) - added by adamsilverstein 12 months ago.

Download all attachments as: .zip

Change History (7)

This ticket was mentioned in PR #4843 on WordPress/wordpress-develop by @adamsilverstein.

12 months ago

  • Keywords has-patch added; needs-patch removed

#3 @adamsilverstein
12 months ago

  • Owner set to adamsilverstein
  • Status changed from new to assigned

This could use some benchmarking and maybe a unit test. It could also be nice to add a "editor load time" metric to our automated performance testing.

Testing instructions:
Complete the following steps before and after patch:

  • Clear browser cache or start a fresh incognito session
  • Log in and navigate to the Posts page
  • Check network console to see the prefetch take place (wp-admin/post-new.php)
  • Try editing a post or creating a new post
  • Record the time it takes for the editor to load and be ready to accept your input

Expected result: the editor should load noticeably faster with the patch.

Last edited 12 months ago by adamsilverstein (previous) (diff)

#4 @johnbillion
12 months ago

  • Version trunk deleted

#5 @mukesh27
12 months ago

  • Milestone changed from Awaiting Review to Future Release

This ticket was discussed in the recent Performance bug scrub.

moving to Future Release for consideration.

Additional props to @joemcgill

#6 @westonruter
7 months ago

Whenever a user visits the wp-admin/post-new.php, an auto-draft post gets created in the DB.

For example, when I view source of that page I see:

<input type='hidden' id='post_ID' name='post_ID' value='151' />

And when I reload I see:

<input type='hidden' id='post_ID' name='post_ID' value='152' />

Will the fact that this is getting prefetched be a problem?

Note: See TracTickets for help on using tickets.