--- memcache.inc 2010-01-11 17:18:27.000000000 -0500 +++ memcache.fix.inc 2010-01-14 15:46:57.000000000 -0500 @@ -45,6 +45,10 @@ */ function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) { $time = time(); + // Set the expiration time if $expire is -1. + if ($expire == CACHE_TEMPORARY) { + $expire = variable_get('cache_lifetime', 2591999) + $time; + } // Create new cache object. $cache = new stdClass; @@ -54,10 +58,6 @@ $cache->expire = $expire; $cache->headers = $headers; - // Save to memcache - if ($expire == CACHE_TEMPORARY) { - $expire = variable_get('cache_lifetime', 2591999); - } // We manually track the expire time in $cache->expire. When the object // expires, we only allow one request to rebuild it to avoid cache stampedes. // Other requests for the expired object while it is still being rebuilt get