You are here

class PermanentMemcacheBackend in Permanent Cache Bin 8

Same name and namespace in other branches
  1. 8.2 modules/pcb_memcache/src/Cache/PermanentMemcacheBackend.php \Drupal\pcb_memcache\Cache\PermanentMemcacheBackend

Defines a permanent memcache cache implementation.

This cache implementation can be used for data like stock which don't really need to be cleared during normal cache rebuilds and need to be cleared . It uses the database to store cached data. Each cache bin corresponds to a database table by the same name.

Hierarchy

Expanded class hierarchy of PermanentMemcacheBackend

File

modules/pcb_memcache/src/Cache/PermanentMemcacheBackend.php, line 18

Namespace

Drupal\pcb_memcache\Cache
View source
class PermanentMemcacheBackend extends MemcacheBackend {

  /**
   * {@inheritdoc}
   */
  public function deleteAll() {

    // This cache doesn't need to be deleted when doing cache rebuild.
    // We do nothing here.
  }

  /**
   * Deletes all cache items in a bin when explicitly called.
   *
   * @see \Drupal\Core\Cache\DatabaseBackend::deleteAll()
   */
  public function deleteAllPermanent() {
    parent::deleteAll();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PermanentMemcacheBackend::deleteAll public function Deletes all cache items in a bin.
PermanentMemcacheBackend::deleteAllPermanent public function Deletes all cache items in a bin when explicitly called.