[wp-trac] [WordPress Trac] #56481: Short-circuit HEAD methods in Core controllers
WordPress Trac
noreply at wordpress.org
Sun Mar 2 22:05:23 UTC 2025
#56481: Short-circuit HEAD methods in Core controllers
---------------------------------------------+-----------------------------
Reporter: TimothyBlynJacobs | Owner:
| TimothyBlynJacobs
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.8
Component: REST API | Version: 4.7
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses: rest-api,
| performance
---------------------------------------------+-----------------------------
Changes (by TimothyBlynJacobs):
* status: accepted => closed
* resolution: => fixed
Comment:
In [changeset:"59899" 59899]:
{{{
#!CommitTicketReference repository="" revision="59899"
REST API: Improve performance for HEAD requests.
By default, the REST API responds to HEAD rqeuests by calling the GET
handler and omitting the body from the response. While convenient, this
ends up performing needless work that slows down the API response time.
This commit adjusts the Core controllers to specifically handle HEAD
requests by not preparing the response body.
Fixes #56481.
Props antonvlasenko, janusdev, ironprogrammer, swissspidy, spacedmonkey,
mukesh27, mamaduka, timothyblynjacobs.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56481#comment:44>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list