REQUEST_TIME ? $expire - REQUEST_TIME : $expire; // Memcached doesn't support expiration values less than 0 (CACHE_PERMANENT). $expire = $expire < CACHE_PERMANENT ? CACHE_PERMANENT : $expire; return MemcacheStorageAPI::set($cid, $data['body'], $expire, $this->bin); } // Process cache set as usual. return parent::set($cid, $data, $expire); } /** * Implements DrupalCacheInterface::clear(). */ function clear($cid = NULL, $wildcard = FALSE) { // If enabled memcache storage external page cache we only may delete cache by key. // This is because memcached doesn't support deletion by wildcard. if (MEMCACHE_STORAGE_EXTERNAL_PAGE_CACHE && !empty($cid) && !$wildcard) { // Convert string to an array to reduce amount of 'if-else' sections. if (!is_array($cid)) { $cid = array($cid); } // Remove HTML page from the cache_page bin. foreach ($cid as $cache_id) { MemcacheStorageAPI::delete($cache_id, $this->bin); } } // Process cache deletion as usual. return parent::clear($cid, $wildcard); } }