#55592 closed enhancement (fixed)
Prime caches for featured images in post rest api controller
Reported by: | spacedmonkey | Owned by: | spacedmonkey |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | REST API | Keywords: | has-patch commit has-unit-tests has-dev-note |
Focuses: | rest-api, performance | Cc: |
Description
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.
Change History (17)
This ticket was mentioned in PR #2611 on WordPress/wordpress-develop by spacedmonkey.
2 years ago
#2
This ticket was mentioned in Slack in #hosting-community by javier. View the logs.
2 years ago
This ticket was mentioned in Slack in #hosting-community by javier. View the logs.
2 years ago
This ticket was mentioned in Slack in #hosting-community by jadonn. View the logs.
2 years ago
This ticket was mentioned in Slack in #hosting-community by javier. View the logs.
2 years ago
This ticket was mentioned in Slack in #hosting-community by jadonn. View the logs.
2 years ago
#10
@
2 years ago
- Keywords has-unit-tests added
@TimothyBlynJacobs Have added a unit tests. Are you happy for me to commit?
spacedmonkey commented on PR #2611:
2 years ago
#13
Committed in https://core.trac.wordpress.org/changeset/53499
#14
@
2 years ago
- Keywords needs-dev-note added
There are a lot of caching related changes in 6.1 and a dev note should be written collecting them all. Marking this for inclusion.
Trac ticket: https://core.trac.wordpress.org/ticket/55592