[wp-trac] [WordPress Trac] #31081: Prime the comments cache in get_comments() rather than in comment_template()

WordPress Trac noreply at wordpress.org
Tue Jan 20 23:07:44 UTC 2015


#31081: Prime the comments cache in get_comments() rather than in
comment_template()
--------------------------+-----------------------------
 Reporter:  dd32          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:
 Severity:  normal        |   Keywords:  has-patch
  Focuses:  performance   |
--------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31081>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list