[wp-trac] [WordPress Trac] #50606: Preload WordPress Rest index endpoint when loading core Gutenberg

WordPress Trac noreply at wordpress.org
Tue Jul 7 20:34:55 UTC 2020


#50606: Preload WordPress Rest index endpoint when loading core Gutenberg
-------------------------+-----------------------------
 Reporter:  jeremyyip    |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:  performance  |
-------------------------+-----------------------------
 **Related:**
 https://github.com/WordPress/gutenberg/pull/22952

 **Context:**
 Data from WordPress REST endpoints can be preloaded before rendering the
 block editor. This allows us to ask the server to inject a response on the
 initial page load. It makes sense if the request will always be triggered
 on that page. The alternative is waiting for the page to load, waiting for
 scripts to execute, and then waiting for a response to the network request
 (which could have been preloaded).

 Core already preloads the WordPress Rest index endpoint, but it does not
 account for variations request urls (like inclusion of query params).

 **Proposal:**
 Preload the `/?context=edit` index endpoint in core

 **Implementation Specifics:**
 Add `/?context=edit` to the list of paths to preload when loading core
 Gutenberg
 https://github.com/WordPress/WordPress/blob/f665e823a53f6b4205f37ff4e3222aacac3ed456
 /wp-admin/edit-form-blocks.php#L41-L53

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50606>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list