You are here

public function TimestampCacheTagsChecksum::invalidateTags in Memcache API and Integration 8.2

Marks cache items with any of the specified tags as invalid.

Parameters

string[] $tags: The list of tags for which to invalidate cache items.

Overrides CacheTagsInvalidatorInterface::invalidateTags

File

src/Cache/TimestampCacheTagsChecksum.php, line 50

Class

TimestampCacheTagsChecksum
Cache tags invalidations checksum implementation by timestamp invalidation.

Namespace

Drupal\memcache\Cache

Code

public function invalidateTags(array $tags) {
  foreach ($tags as $tag) {

    // @todo Revisit this behavior and determine a better way to handle.
    // Only invalidate tags once per request unless they are written again.
    if (isset($this->invalidatedTags[$tag])) {
      continue;
    }
    $this->invalidatedTags[$tag] = TRUE;
    $this->tagCache[$tag] = $this->invalidator
      ->invalidateTimestamp($tag);
  }
}