#56272 closed enhancement (fixed)
REST API: Prime post caches in comments in endpoint.
Reported by: | spacedmonkey | Owned by: | peterwilsoncc |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | has-patch commit has-dev-note |
Focuses: | performance | Cc: |
Description
In the WP_REST_Comments_Controller
class, there are multiple calls to the comment's post, why calling get_post like this,
$post = get_post( (int) $comment->comment_post_ID );
Post caches should be primed using the update_comment_post_cache
param.
Attachments (2)
Change History (13)
This ticket was mentioned in PR #3014 on WordPress/wordpress-develop by spacedmonkey.
2 years ago
#1
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/56272
TimothyBJacobs commented on PR #3014:
2 years ago
#2
Aside from the CS issue, looks good to merge to me.
#3
@
2 years ago
- Keywords commit added
- Owner set to spacedmonkey
- Status changed from new to assigned
#4
@
2 years ago
- Milestone changed from Future Release to 6.1
- Owner changed from spacedmonkey to peterwilsoncc
I think this can go in 6.1.
I've self assigned it for commit as Jonny is AFK for the next few weeks.
peterwilsoncc commented on PR #3014:
2 years ago
#6
Committed in https://core.trac.wordpress.org/changeset/53772 (c1cf07e4e30cf0a2fde3f2be0a6983025b3d2062)
#7
@
2 years ago
There are a lot of caching API related changes in 6.1 and a dev note should be written collecting them all. Marking this for inclusion.
Before