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

WordPress Trac noreply at wordpress.org
Wed Jan 30 16:09:27 UTC 2019


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

Comment (by johnbillion):

 @tellyworth One side effect of calling `fastcgi_finish_request()` is that
 any output produced by a shutdown function (or a function hooked to the
 `shutdown` action) will not be visible, as the request has already been
 finished.

 I noticed this with another application that was calling
 `fastcgi_finish_request()` and caused Query Monitor to break, as its
 output is produced on the `shutdown` action and therefore wasn't returned
 in the response.

 This is not a concern for wp-cron.php but it's definitely worth bearing in
 mind for other contexts.

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


More information about the wp-trac mailing list