{@inheritDoc}
@see \Psr\Cache\CacheItemInterface::expiresAfter()
544904
public final function expiresAfter($time)
   {
       $this->timeToLive = $time instanceof DateInterval
                         ? (new DateTime())->add($time)->getTimestamp()
                         - time()
                         : (int) $time;
       return $this;
   }
312072
public function expire($key) {

		if(false === is_string($key) && false === is_array($key)) {
   			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
   		}

   		if(0 === strlen($key)) {
   			return trigger_error(sprintf('Argument 1 passed to %s() may not be an empty string', __METHOD__), E_USER_ERROR);
   		}

		apcu_delete($key);
		return $this;
	}
587928
private function getControledExpireTime($expire)
    {
        $lifetime = $this->getControledLifetime($expire - time());

        if (0 < $lifetime) {
            return time() + $lifetime;
        }

        return $expire;
    }
1359072
public function flushExpired()
    {
        foreach ($this->_hashes as $name => $hashes) {
            foreach ($hashes as $key => $hash) {
                $cookie = $this->_data[$hash];
                if ($cookie->expired()) {
                    unset($this->_data[$hash]);
                    unset($this->_names[$hash]);
                    unset($this->_hashes[$name][$key]);
                    if (!$this->_hashes[$name]) {
                        unset($this->_hashes[$name]);
                    }
                }
            }
        }
        return $this;
    }
1234083
public function save(CacheItemInterface $item)
    {
        $expirationTime = null;

        if ($item instanceof ExtractableCacheLifetimeInterface) {
            $expirationTime = $item->getCacheLifetime();
        }

        return $this->cacheFrontend->save(
            serialize((
                $item instanceof ExtractableCacheValueInterface ?
                    $item->getCacheValue() :
                    $item->get()
            )),
            $this->prepareKey($item->getKey()),
            $this->tags,
            $expirationTime
        );
    }
413901
function set($key, $value, $expire = 0)
    {
        if ($expire <= 0)
        {
            $expire = 0x7fffffff;
        }
        return $this->redis->setex($key, $expire, serialize($value));
    }
1097944
private static function withExpires(
        ResponseInterface $response,
        CacheUtil $util,
        string $expires
    ): ResponseInterface {
        $expires = new DateTime($expires);
        $cacheControl = ResponseCacheControl::fromString($response->getHeaderLine('Cache-Control'))
            ->withMaxAge($expires->getTimestamp() - time());

        $response = $util->withExpires($response, $expires);

        return $util->withCacheControl($response, $cacheControl);
    }
374508
public function set($key, $value = null, $expiration = 0)
    {
        if (apc_store($key, $value, ($expiration ? $expiration : null))) {
            $expiration = (empty ($expiration)) ? 0 : $expiration;

            // Prepare Listing
            $newListing = array(
                'key'        => ( string )$key,
                'expiration' => ( int )$expiration,
                'updated'    => ( string )date('Y-m-d H:i:s')
            );

            if (isset ($this->cacheListing [$key])) {
                $this->cacheListing [$key] = array_merge($this->cacheListing [$key], $newListing);
            } else {
                $newListing ['created']    = $newListing ['updated'];
                $this->cacheListing [$key] = $newListing;
            }

            $this->saveCacheListing();

            return true;
        }

        return false;
    }
200100
public function cleanUp( $expires = 0 )
	{
		$expires	= $expires ? $expires : $this->expires;
		if( !$expires )
			throw new InvalidArgumentException( 'No expire time given or set on construction.' );

		$number	= 0;
		$index	= new DirectoryIterator( $this->path );
		foreach( $index as $entry )
		{
			if( $entry->isDot() || $entry->isDir() )
				continue;
			$pathName	= $entry->getPathname();
			if( substr( $pathName, -7 ) !== ".serial" )
				continue;
			if( $this->isExpired( $pathName, $expires ) )
				$number	+= (int) @unlink( $pathName );
		}
		return $number;
	}
23944
public function setExpires($expires)
    {
        if (empty($expires)) {
            return $this;
        }

        $this->expires = strtotime($expires);

        return $this;
    }
766301
public function setExpire($expire)
	{
		if (null !== $expire)
		{
			$this->expire = $expire instanceof \DateTime ? $expire->getTimestamp() : (int) $expire;
		}
		else
		{
			$this->expire = $expire;
		}

		return $this;
	}
577864
public function setExpires($expires)
    {
        if ($expires !== null && !$expires instanceof \DateTime) {
            $expires = new \DateTime('@' . $expires);
        }
        $this->expires = $expires;

        return $this;
    }
1344811
public function cache($key, $expires = null) {
        if ($this->getType() !== self::SELECT) {
            return $this;
        }

        $this->_cacheKey = $key;
        $this->_cacheLength = $expires;

        return $this;
    }
1249648
static function expireCache( $expireCluster = true )
    {
        unset( $GLOBALS['eZContentLanguageList'],
               $GLOBALS['eZContentLanguagePrioritizedLanguages'],
               $GLOBALS['eZContentLanguageMask'],
               $GLOBALS['eZContentLanguageCronjobMode'] );

        // With the solution to #14227 we also need to clear the cached
        // list of languages
        if ( $expireCluster )
        {
            $cachePath = eZSys::cacheDirectory() . '/ezcontentlanguage_cache.php';
            eZClusterFileHandler::instance()->fileDelete( $cachePath );
        }
    }
774218
public static function SendExpires( $expireStamp = null )
   {

      if ( \is_null( $expireStamp ) || empty( $expireStamp ) )
      {
         $expireStamp = \time();
      }

      if ( \is_int( $expireStamp ) )
      {
         \header( 'Expires: ' . \date( 'D, d M Y H:i:s O', $expireStamp ) );
      }
      else if ( $expireStamp instanceof \DateTimeInterface )
      {
         \header( 'Expires: ' . $expireStamp->format( 'D, d M Y H:i:s O' ) );
      }
      else if ( TypeTool::IsInteger( $expireStamp ) )
      {
         \header( 'Expires: ' . \date( 'D, d M Y H:i:s O', \intval( $expireStamp ) ) );
      }
      else if ( TypeTool::IsStringConvertible( $expireStamp, $str ) )
      {
         $stamp = \strtotime( $str );
         if ( $stamp > 0 )
         {
            \header( 'Expires: ' . \date( 'D, d M Y H:i:s O', $stamp ) );
         }
      }

   }
547489
public function setExpiry(?\DateTimeImmutable $expiry = null): void
    {
        $date = new \DateTimeImmutable();
        $expiry = $expiry ?: $date;

        $this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
        $this->setHeader('Expires', $expiry->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));

        if ($expiry <= $date) {
            $this->setHeader('Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0');

            return;
        }

        $maxAge = $expiry->getTimestamp() - $date->getTimestamp();
        $this->setHeader('Cache-Control', 'public, max-age=' . $maxAge);
    }
128657
protected function addExpire(Builder $builder): void
    {
        $builder->macro('expire', function (Builder $builder) {
            return $builder->update(['is_expired' => 1]);
        });
    }