#107316Negative cache lifetime calculated for page cache
Description
the same issue as in Bug #105776 may occur in TYPO3 12.4 too:
When a page has a starttime or endtime setting in the past, a negative cachetime is calculated. This will result in caches that are never used or will even throw an exception, like when using the RedisBackend.
The problem seems to be in the method \TYPO3\CMS\Frontend\Cache\CacheLifetimeCalculator::calculateLifetimeForPage. If a page, has a starttime, the cachetimeout is calculated as $starttime – $currenttime “. If the starttime is in the past, the resulting cache TTL is negative.
Tested with TYPO3 12.4.34 with the redis backend used for the page cache.