Opened 10 years ago
Closed 9 years ago
#31081 closed enhancement (fixed)
Prime the comments cache in get_comments() rather than in comment_template()
Reported by: | dd32 | Owned by: | rachelbaker |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | performance | Cc: |
Description
At present, update_comment_cache()
is called within comments_template()
, on the result of get_comments()
.
Unfortunately this means that any plugins which use get_comments()
and then use a function which relies upon a comment object, for example, get_comment_author_link( $comment_id )
it'll have a cache-miss and query the DB for data that we could've primed ourselves.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Refreshed the patch so it applies cleanly. This is a small fix that appears to me to work as intended. Milestoning for 4.3