memcache doesn't support the cache_lifetime variable, and i wanted to get some feedback on that.

i could be missing something, but it looks to me that in the default core ache.inc, cache_clear_all() or cache_clear_all(NULL, 'cache_table') will only expire items that are older than variable_get('cache_lifetime', 0) and it will never expire items that are CACHE_PERMANENT.

in memcache, cache_clear_all() flushes the entire bin - permanent and unexpired stuff included.

since memcache handles expiry automatically, it seems to me that it would be more correct behavior for cache_clear_all() to do nothing! right now the various modules cache_clear_all calls are wiping out way more than they should.

CommentFileSizeAuthor
#3 memcache.inc_.186368.patch1.1 KBfirebus

Comments

robertdouglass’s picture

This is a good point and I'll do some thinking on it. Thanks for all the recent issues and patches.

firebus’s picture

looking into this change, i see that it's a little more nuanced.

if cid is not set, then cache.inc will delete every expired item from the cache table. in this case, i think memcache should do nothing since memcache handles expiry automatically.

BUT if cid == '*' and wildcard == TRUE, then cache.inc will empty the table. in this case, i think memcache should do dmemcache_flush on the table.

firebus’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

patch for this.

firebus’s picture

Assigned: Unassigned » firebus
Status: Needs review » Closed (duplicate)

this is a dupe with http://drupal.org/node/199483, which provides a more complete improvement to this function.