This affects the cache_clear_all function:

In drupal's cache.inc:

  else {
    if ($wildcard) {
      if ($cid == '*') {
        db_query("DELETE FROM {". $table ."}");
      }
      else {
        db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);
      }
    }
    else {
      db_query("DELETE FROM {". $table ."} WHERE cid = '%s'", $cid);
    }
  }

In cacherouter's code:

  else {
    if ($wildcard) {
      if ($cid == '*') {
        $cache->delete('*', $table);
      }
      else {
        $cache->delete($cid . '*', $table);
      }
    }
    else {
      $cache->delete($cid, $table);
    }
  }

As you can see if you do not provide wildcard TRUE, the $cid is treated as the actual key to delete. In cacherouter however the same thing is done when having wildcard TRUE and wildcard FALSE:

$cache->delete('*', $table);

Comments

andypost’s picture

Suppose $cache->delete('*', $table); same as $cache->flush() which is not flushing temps with timestamp

andypost’s picture

So what is difference between $cache->delete(...) and $cache->flush(...) ?

Supose we need only delete method for clearing and flush as garbagecollector

slantview’s picture

Status: Needs review » Postponed
slantview’s picture

Status: Postponed » Closed (fixed)