[wp-trac] [WordPress Trac] #55592: Prime caches for featured images in post rest api controller
WordPress Trac
noreply at wordpress.org
Wed Apr 20 16:52:46 UTC 2022
#55592: Prime caches for featured images in post rest api controller
--------------------------+----------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version: 4.2
Severity: normal | Keywords: has-patch
Focuses: rest-api |
--------------------------+----------------------------
In the post api controller, if the post type supports thumbnails, this
results a query to be run for each post's thumbnail. For a REST API
request with 100 posts in it, this can result in lots of queries. In core
there is already a function called `update_post_thumbnail_cache`, used to
prime post thumbnails. However, this does not seem to be fired here. A
simple fix would be to fire `update_post_thumbnail_cache` in the post
controller.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55592>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list