[wp-trac] [WordPress Trac] #41358: Shutdown hooks can significantly slow down REST API responses

WordPress Trac noreply at wordpress.org
Wed Aug 9 09:33:01 UTC 2017


#41358: Shutdown hooks can significantly slow down REST API responses
-------------------------------------------------+-------------------------
 Reporter:  mikejolley                           |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  REST API                             |  Review
 Severity:  normal                               |     Version:
 Keywords:  has-patch dev-feedback needs-        |  Resolution:
  testing                                        |     Focuses:  rest-api,
                                                 |  performance
-------------------------------------------------+-------------------------
Changes (by mikejolley):

 * keywords:   => has-patch dev-feedback needs-testing


Comment:

 I've added a REST API specific patch since this has the lowest barrier to
 entry, resolves the problem where it's most noticeable, and should be
 easier to test.

 https://core.trac.wordpress.org/attachment/ticket/41358/end-rest-api-
 connection-41358.diff

 New method uses `fastcgi_finish_request` if possible otherwise defaults to
 sending headers.

 To see how much of an improvement it makes, use the code in the original
 post. If you make a request to the API, before patch you'll wait at least
 3 seconds to see the response. After patch, the request is sent instantly.

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


More information about the wp-trac mailing list