[wp-trac] [WordPress Trac] #55593: Prime caches for post parents in post rest api controller
WordPress Trac
noreply at wordpress.org
Wed Apr 20 17:02:14 UTC 2022
#55593: Prime caches for post parents in post rest api controller
-----------------------------------+----------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version:
Severity: normal | Keywords: has-patch
Focuses: rest-api, performance |
-----------------------------------+----------------------------
In the Post REST controller, for every post with post status of inherit
and a parent post set, a lookup for the parent is done in the
`check_read_permission` method. For a response with 100 posts, this could
result in 100 queries to the posts table. Instead of looking up one by
one, simple use `_prime_post_caches` and prime caches for all parents in
one request.
Related #55592.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55593>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list