[wp-trac] [WordPress Trac] #36906: Comment caches should be persistent

WordPress Trac noreply at wordpress.org
Wed Jun 1 21:44:28 UTC 2016


#36906: Comment caches should be persistent
--------------------------+---------------------------
 Reporter:  boonebgorges  |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.6
Component:  Comments      |     Version:  2.2
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |     Focuses:  performance
--------------------------+---------------------------

Comment (by spacedmonkey):

 @boonebgorges it's doesn't fix a bug, but it adds consistency to the
 insert functions. Both posts and terms call the function for different
 reasons.

 https://github.com/WordPress/WordPress/blob/477f6346eb3935f8d2672b6e4ec2359e7d23ef6b
 /wp-includes/taxonomy.php#L2410
 https://github.com/WordPress/WordPress/blob/9193013158d02ecd51ab8aa52d594aa789ac9836
 /wp-includes/post.php#L3430

 If you are building a caching plugin or the like for comments, it is a
 expected that when you create function would also all the cache clean
 function. I had to add a work around to get my comment caching plugin
 working.

 Example here
 https://github.com/spacedmonkey/advanced-comment-cache/blob/master
 /advanced-comment-cache.php#L104-L107

 For developing plugins, it is important that the 'clean_comment_cache'
 action runs on insert of comments as well. I know that it will delete
 nothing likely, as the no object will not exist, but it will not hurt.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36906#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list