I don't see code for clearing the cache. Currently, the only way is restarting memcached but it's not a nice option when you have multisite with one memcached.

Comments

ogi’s picture

Title: Ability to clear memcached's cache » Flushing cache doesn't work as intended
Category: feature » bug

I found why my cache wasn't flushed. In MemCacheDrupal's constructor, there's the following code for cutting cache entries before flush time:

$this->flushed = min($this->cache_flush, REQUEST_TIME - $this->cache_lifetime);

Then valid() method checks if the entry should be discarded:

// Determine when the current bin was last flushed.
$item_flushed_globally = $cache->created && $this->cache_flush &&
$this->cache_lifetime &&
($cache->created <= $this->flushed);

So when there's no cache_lifetme, nothing is ever flushed. Where there's cache_lifetime, $this->flushed just cuts before cache_lifetime or more, but never after REQUEST_TIME - $this->cache_lifetime. All this just disables the whole flush concept.

catch’s picture

Status: Active » Closed (fixed)

This should be fixed in latest dev.

jasonabc’s picture

Status: Closed (fixed) » Active

Do you have a fix for the D6 version? We are experiencing this also on our D6 sites. Clearing cache doesn't flush memcache - we have to flush it manually and that is affecting other sites that use it.

jeremy’s picture

Version: 7.x-1.0-beta3 » 6.x-1.x-dev
Issue summary: View changes

Tagging as a 6.x issue.

japerry’s picture

Status: Active » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.