[wp-trac] [WordPress Trac] #56481: Short-circuit HEAD methods in Core controllers

WordPress Trac noreply at wordpress.org
Thu Mar 27 06:27:46 UTC 2025


#56481: Short-circuit HEAD methods in Core controllers
--------------------------------------+------------------------------------
 Reporter:  TimothyBlynJacobs         |       Owner:  TimothyBlynJacobs
     Type:  task (blessed)            |      Status:  reopened
 Priority:  normal                    |   Milestone:  6.8
Component:  REST API                  |     Version:  4.7
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api, performance
--------------------------------------+------------------------------------

Comment (by devsahadat):

 Thanks for submitting the patch to improve HEAD request handling. It
 successfully skips unnecessary body generation, improving performance,
 especially for collection routes. The approach of querying only IDs for
 pagination headers is effective.

 Suggestions:

 Extend this fix to other controllers (e.g., WP_REST_Search_Controller).

 Ensure compatibility with custom endpoints or plugins using rest_prepare_
 filters.

 Looking forward to further improvements!

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


More information about the wp-trac mailing list