[wp-trac] [WordPress Trac] #52992: REST API: Avoid unnecessarily preparing item links

WordPress Trac noreply at wordpress.org
Fri Jul 22 13:59:00 UTC 2022


#52992: REST API: Avoid unnecessarily preparing item links
-------------------------------------------------+-------------------------
 Reporter:  dlh                                  |       Owner:
                                                 |  spacedmonkey
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing needs-testing-info commit              |  performance
-------------------------------------------------+-------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53760" 53760]:
 {{{
 #!CommitTicketReference repository="" revision="53760"
 REST API: Avoid unnecessarily preparing item links.

 Do not call the `prepare_links` methods in core REST API controllers,
 unless the `_links` or `_embedded` fields are requested. There is no need
 to prepare links if they are never returned in the response. This saves
 resources, as many calls to `prepare_links` methods perform database
 queries.

 Props Spacedmonkey, timothyblynjacobs, rachelbaker, desrosj, dlh,
 hellofromTonya.
 Fixes #52992.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52992#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list