[wp-hackers] Caching of numbers of comments?

Peter Westwood peter.westwood at ftwr.co.uk
Thu Dec 22 15:53:51 GMT 2005

On Thu, December 22, 2005 1:25 pm, Sebastian Herp wrote:
> Hello list,
> wordpress 2.0 RC3 seems to cache a lot of things. Does it cache the
> number of comments returned by the "comments_number"-function? Because
> that number seems to be displayed wrong in several postings. Why exactly
> does this need caching or is this bug not related to the cache?
> Example:
> http://www.sebbi.de/archives/2005/12/21/premiere-weg-vom-fenster/
> The function currently returns "5 comments" while I definetly see 6 ...

Comment Count is stored in the db against each post to save on queries for
the front page. (New in 2.0)

I suspect you are running a comment processing plugin that die()'s inside
the hook like Spam Karma 2 does (The fix for which is here -

Peter Westwood
Blog: http://blog.ftwr.co.uk

More information about the wp-hackers mailing list