W3cubDocs

/Drupal 8

interface CacheTagsChecksumInterface

Provides checksums for cache tag invalidations.

Cache backends can use this to check if any cache tag invalidations happened for a stored cache item.

To do so, they can inject the cache_tags.invalidator.checksum service, and when a cache item is written, store cache tags together with the current checksum, calculated by getCurrentChecksum(). When a cache item is fetched, the checksum can be validated with isValid(). The service will return FALSE if any of those cache tags were invalidated in the meantime.

Hierarchy

Related topics

Cache API
Information about the Drupal Cache API

File

core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php, line 19

Namespace

Drupal\Core\Cache

Members

Name Modifiers Type Description
CacheTagsChecksumInterface::getCurrentChecksum public function Returns the sum total of validations for a given set of tags.
CacheTagsChecksumInterface::isValid public function Returns whether the checksum is valid for the given cache tags.
CacheTagsChecksumInterface::reset public function Reset statically cached tags.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!CacheTagsChecksumInterface.php/interface/CacheTagsChecksumInterface/8.1.x