/**
* {@inheritdoc}
*/
public function getCacheTime(Request
$request) { $action =
$this->cacheRouteGeneration->
getActionRoute($request);
$invalidationDate = null;
$defaultInvalidationTime =
$this->cacheTimeService->
getCacheTime($request);
/** @var InvalidationDateInterface $dateProvider */
foreach ($this->invalidationDateProvider
as $dateProvider) { if ($dateProvider->
supportsRoute($action) &&
$invalidationDate =
$dateProvider->
getInvalidationDate($request)) { $difference =
(int) $invalidationDate->
format('U'
) -
(int) (new DateTime())->
format('U'
);
return $difference > 0 &&
$difference <
$defaultInvalidationTime ?
$difference :
$defaultInvalidationTime;
} } return $defaultInvalidationTime;
}}