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.
Comments
Comment #1
robertdouglass commentedThis is a good point and I'll do some thinking on it. Thanks for all the recent issues and patches.
Comment #2
firebus commentedlooking 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.
Comment #3
firebus commentedpatch for this.
Comment #4
firebus commentedthis is a dupe with http://drupal.org/node/199483, which provides a more complete improvement to this function.