You are here

public function ChainedFastRawBackend::delete in Supercache 2.0.x

Same name and namespace in other branches
  1. 8 src/Cache/ChainedFastRawBackend.php \Drupal\supercache\Cache\ChainedFastRawBackend::delete()

Deletes an item from the cache.

If the cache item is being deleted because it is no longer "fresh", you may consider using invalidate() instead. This allows callers to retrieve the invalid item by calling get() with $allow_invalid set to TRUE. In some cases an invalid item may be acceptable rather than having to rebuild the cache.

Parameters

string $cid: The cache ID to delete.

Overrides CacheRawBackendInterface::delete

See also

\Drupal\Core\Cache\CacheRawBackendInterface::deleteMultiple()

\Drupal\Core\Cache\CacheRawBackendInterface::deleteAll()

File

src/Cache/ChainedFastRawBackend.php, line 198
Contains \Drupal\supercache\Cache\ChainedFastRawBackend.

Class

ChainedFastRawBackend
Defines a backend with a fast and a consistent backend chain.

Namespace

Drupal\supercache\Cache

Code

public function delete($cid) {
  $this->consistentBackend
    ->deleteMultiple(array(
    $cid,
  ));
  $this->fastBackend
    ->deleteMultiple(array(
    $cid,
  ));
  $this
    ->markAsOutdated();
}