diff --git a/drupal_apc_cache.inc b/drupal_apc_cache.inc
index 98165a7..a879e12 100644
--- a/drupal_apc_cache.inc
+++ b/drupal_apc_cache.inc
@@ -51,9 +51,6 @@ class DrupalAPCCache implements DrupalCacheInterface {
   }
 
   function get($cid) {
-    // Garbage collection necessary when enforcing a minimum cache lifetime.
-    $this->garbageCollection($this->bin);
-
     // Add a get to our statistics.
     $GLOBALS['apc_statistics'][] = array('get', $this->bin, array($cid));
 
@@ -106,9 +103,6 @@ class DrupalAPCCache implements DrupalCacheInterface {
   }
 
   function getMultiple(&$cids) {
-    // Garbage collection necessary when enforcing a minimum cache lifetime.
-    $this->garbageCollection($this->bin);
-
     // We need to search the cache with the proper keys and
     // be able to get the original $cid back.
     foreach ($cids as $cid) {
@@ -130,25 +124,6 @@ class DrupalAPCCache implements DrupalCacheInterface {
     return $cache;
   }
 
-  /**
-   * Garbage collection for get() and getMultiple().
-   *
-   * @param $bin
-   *   The bin being requested.
-   */
-  protected function garbageCollection() {
-    global $user;
-
-    // Garbage collection necessary when enforcing a minimum cache lifetime.
-    $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
-    if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= REQUEST_TIME)) {
-      // Reset the variable immediately to prevent a meltdown in heavy load situations.
-      variable_set('cache_flush_' . $this->bin, 0);
-      // Time to flush old cache data
-      $this->clearTemporary();
-    }
-  }
-
   function set($cid, $data, $expire = CACHE_PERMANENT, array $headers = NULL) {
     // Add set to statistics.
     $GLOBALS['apc_statistics'][] = array('set', $this->bin, $cid);
@@ -190,91 +165,63 @@ class DrupalAPCCache implements DrupalCacheInterface {
     }
   }
 
-  function clearTemporary() {
-    $data = apc_cache_info('user');
-    $count = count($data['cache_list']);
+  /**
+   * Escape string for raw using in a PCRE regex.
+   * 
+   * @param string $unsafeString
+   * 
+   * @return string
+   *   Safe string.
+   */
+  protected function escapeStringForRegex($unsafeString) {
+    return preg_replace('/[\/\.\[\]\(\)\|]/', '\\\\\\0', $unsafeString);
+  }
 
-    for ($i = 0; $i < $count; $i++) {
-      if (strpos($data['cache_list'][$i]['info'], $this->binKey()) === 0) {
-        $cache = apc_fetch($data['cache_list'][$i]['info']);
-        if ($cache && $cache->expire == CACHE_TEMPORARY) {
-          apc_delete($data['cache_list'][$i]['info']);
-        }
-      }
+  /**
+   * Delete CID matching the given prefix.
+   * 
+   * @param string $prefix
+   */
+  protected function deletePrefix($prefix) {
+    $match = $this->escapeStringForRegex($this->binKey() . $prefix);
+    $iterator = new APCIterator('user', '/^' . $match . '/', APC_ITER_KEY);
+    foreach ($iterator as $key => $data) {
+      apc_delete($key);
     }
   }
 
-  function clear($cid = NULL, $wildcard = FALSE) {
-    global $user;
+  /**
+   * Flush all cache items in a bin.
+   */
+  function flush() {
+    $iterator = new APCIterator('user', NULL, APC_ITER_KEY);
+    foreach ($iterator as $key => $data) {
+      apc_delete($key);
+    }
+  }
 
+  function clear($cid = NULL, $wildcard = FALSE) {
     // Add a get to our statistics.
     $GLOBALS['apc_statistics'][] = array('clear', $this->bin, $cid, (int)$wildcard);
 
-    if (empty($cid)) {
-      if (variable_get('cache_lifetime', 0)) {
-        // We store the time in the current user's $user->cache variable which
-        // will be saved into the sessions bin by _drupal_session_write(). We then
-        // simulate that the cache was flushed for this user by not returning
-        // cached data that was cached before the timestamp.
-        $user->cache = REQUEST_TIME;
-
-        $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
-        if ($cache_flush == 0) {
-          // This is the first request to clear the cache, start a timer.
-          variable_set('cache_flush_' . $this->bin, REQUEST_TIME);
-        }
-        elseif (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime', 0))) {
-          // Clear the cache for everyone, cache_lifetime seconds have
-          // passed since the first request to clear the cache.
-          $this->clearTemporary();
-          variable_set('cache_flush_' . $this->bin, 0);
-        }
-      }
-      else {
-        $this->clearTemporary();
-      }
-    }
-    else {
+    if (!empty($cid)) {
       if ($wildcard) {
-        $data = apc_cache_info('user');
-        $count = count($data['cache_list']);
-
         if ($cid == '*') {
-          for ($i = 0; $i < $count; $i++) {
-            if (strpos($data['cache_list'][$i]['info'], $this->binKey()) === 0) {
-              apc_delete($data['cache_list'][$i]['info']);
-            }
-          }
+          $this->flush();
         }
         else {
-          for ($i = 0; $i < $count; $i++) {
-            if (strpos($data['cache_list'][$i]['info'], $this->key($cid)) === 0) {
-              apc_delete($data['cache_list'][$i]['info']);
-            }
-          }
-        }
-      }
-      elseif (is_array($cid)) {
-        foreach ($cid as $delete_cid) {
-          apc_delete($this->key($delete_cid));
+          $this->deletePrefix($cid);
         }
       }
       else {
-        apc_delete($this->key($cid));
+        apc_delete($this->binKey() . $cid);
       }
     }
   }
 
   function isEmpty() {
-    $data = apc_cache_info('user');
-    $count = count($data['cache_list']);
-
-    for ($i = 0; $i < $count; $i++) {
-      if (strpos($data['cache_list'][$i]['info'], $this->binKey()) === 0) {
-        return FALSE;
-      }
-    }
-
-    return TRUE;
+    $match = $this->escapeStringForRegex($this->binKey());
+    $iterator = new APCIterator('user', '^/' . $match . '/', APC_ITER_KEY);
+    return 0 === $iterator->getTotalCount();
   }
 }
