[wp-trac] [WordPress Trac] #10615: Recent Comments Widget Should Use Comments API

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 24 09:41:30 UTC 2009


#10615: Recent Comments Widget Should Use Comments API
--------------------------+-------------------------------------------------
 Reporter:  filosofo      |       Owner:                                                        
     Type:  defect (bug)  |      Status:  new                                                   
 Priority:  normal        |   Milestone:  3.0                                                   
Component:  Comments      |     Version:  2.9                                                   
 Severity:  normal        |    Keywords:  get_comments WP_Widget_Recent_Comments has-patch early
--------------------------+-------------------------------------------------

Comment(by westi):

 Replying to [comment:5 filosofo]:
 > Replying to [comment:4 azaozz]:
 > > Why remove the explicit caching? That will force blogs with persistent
 cache to run the rest of the code on almost every page load.
 >
 > Ok, taking that into account, third patch does what the recent posts
 widget cache does: it uses the query API but caches the ''printed
 output''.
 >
 > Improvements:
 >  * Still using API instead of direct db calls
 >  * Likely to have to query less in most cases, as default 5 queried
 comments is less than previous 15 comments no matter what.
 >  * Persistent cache of output instead of serialized comment objects
 means we're caching a smaller amount of data but interrupting sooner,
 thereby reducing processing and memory use.

 Looks good.

 Do we really need to use output buffering and echos here?

 Can we not just build up the html as a string and cache that?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10615#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list