Memcached is breaking private messaging

I’ve got a large blog farm with multi-db’s using memcached & batcache to handle the load. The problem is that with BP, if I click to send a private message to a user, it shows the wrong recipient on the composition screen.
If I flush the cache and try again it works.

Has anyone else been able to tweak the caching settings with object-cache.php or advanced-cache.php to get this to work?

Here’s what I have:

function batcache_cancel() {
global $batcache;

if ( is_object($batcache) )
$batcache->cancel = true;
}

class batcache {
// This is the base configuration. You can edit these variables or move them into your wp-config.php file.
var $max_age = 180; // Expire batcache items aged this many seconds (zero to disable batcache)

Hmm, I was under the impression batcache would only cache public pages (non-logged in users). The above seems to indicate otherwise. Is batcache really buddypress aware (I noticed the last update of the plugin via the repo was back in April ’09).

Thanks for the link, but I’m confused a bit. My current code already has that patch in it, changing the “public” to “private” looks to be the only switch. I’m guessing this was changed in a more recent BP release?

And, you said:

“With the patch, you’d still need to apply a filter to “bp_get_send_private_message_link” and override it so it doesn’t use bp_core_get_username().

The same problem occurs with the bp_get_send_public_message_link() function – aka the “Mention this user” link.”

It sounds like this is the step I need to take. How exactly do I apply this filter?