public function isCacheIsValid($key, $timestamp)
{
$parents = explode('/', $key);
$code = '';
foreach ($parents as $parent) {
$code .= $parent;
$invalidateTime = $this->distributedCache->getInvalidate($code);
if (null !== $invalidateTime && $invalidateTime >= $timestamp) {
//we found a invalidation that is newer than the cache of $timestamp
//this means this cache has been invalidated.
return false;
}
$code .= '/';
}
return true;
}