Opened 17 months ago
Last modified 4 months ago
#58801 assigned enhancement
Prefetch Block Editor from Posts page
Reported by: | adamsilverstein | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | dev-feedback needs-unit-tests needs-testing has-patch |
Focuses: | performance | Cc: |
Description
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)
Change History (9)
This ticket was mentioned in PR #4843 on WordPress/wordpress-develop by @adamsilverstein.
17 months ago
#1
- Keywords has-patch added; needs-patch removed
This ticket was mentioned in PR #4843 on WordPress/wordpress-develop by @adamsilverstein.
17 months ago
#2
Trac ticket: https://core.trac.wordpress.org/ticket/58801
#3
@
17 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
More dramatic results with network throttling enabled.
Expected result: the editor should load noticeably faster with the patch.
#5
@
17 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
follow-up:
↓ 7
@
13 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?
#7
in reply to:
↑ 6
@
4 months ago
Replying to westonruter:
Whenever a user visits the
wp-admin/post-new.php
, an auto-draft post gets created in the DB.
Ah, good catch!
We should be able to address that on the post-new.php side by not firing the initial autosave when we detect a prerender.
Trac ticket: https://core.trac.wordpress.org/ticket/58801