[wp-trac] [WordPress Trac] #43956: _embed parameter should accept options on what to embed

WordPress Trac noreply at wordpress.org
Fri May 4 09:21:13 UTC 2018


#43956: _embed parameter should accept options on what to embed
-----------------------------+-----------------------------
 Reporter:  k1sul1           |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  REST API         |    Version:
 Severity:  normal           |   Keywords:  needs-patch
  Focuses:                   |
-----------------------------+-----------------------------
 When creating a JavaScript powered single page application, performance is
 critical, and that's where `_embed` comes in. Instead of making separate
 requests for author, featured media, replies & terms, we can simply add
 `_embed=1` as a query parameter, and everything embeddable is embedded
 into the response. HTTP2 is a thing, but WordPress bootstrap tends to take
 a while.

 The thing is, in our use case, we really do not want the replies to be
 embedded, as they're useless until the user actually reads the article.
 That's why we'd like to load them in a separate request when they're
 actually needed.

 We load dozens of posts in the front page of our app, which equals a "lot"
 of unneeded replies being loaded, and embedding replies can't be free in
 terms of performance.

 Could we specify what we want to embed, in the parameter?

 Something like `?_embed=featured_media,terms,author`. `?_embed=1` would
 still embed everything, so anything existing shouldn't break.

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


More information about the wp-trac mailing list