Opened 11 years ago
Closed 11 years ago
#31081 closed enhancement (fixed)
Prime the comments cache in get_comments() rather than in comment_template()
| Reported by: | dd32 | Owned by: | rachelbaker |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.3 |
| Component: | Comments | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | performance |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Refreshed the patch so it applies cleanly. This is a small fix that appears to me to work as intended. Milestoning for 4.3