#110660config.cache_clearAtMidnight is a no-op since the default cache lifetime was raised to one year
Description
- raised CacheLifetimeCalculator::defaultCacheTimeout from 86400 (24 hours)
to 365 * 86400 (one year). It was released with 14.3.1 (main and 14.3).
That constant is also the fallback for the TypoScript setting config.cache_period:
// typo3/sysext/frontend/Classes/Cache/CacheLifetimeCalculator.php:115 // Cache period was set via TypoScript "config.cache_period", otherwise it's the default of 24 hours $cacheTimeout = (int)($renderingInstructions['cache_period'] ?? self::defaultCacheTimeout);
The inline comment above that line still says 24 hours and is outdated as well.
As a side effect, config.cache_clearAtMidnight silently lost its effect in the
default configuration. The CacheTimeout middleware rounds down to midnight of the
day the page is scheduled to expire:
// typo3/sysext/frontend/Classes/Middleware/CacheTimeout.php:41
$timeOutTime = min($GLOBALS['EXEC_TIME'] + $cacheDataCollector->resolveLifetime(), PHP_INT_MAX);
$midnightTime = mktime(0, 0, 0, (int)date('m', $timeOutTime), (int)date('d', $timeOutTime), (int)date('Y', $timeOutTime));
if ($midnightTime > $GLOBALS['EXEC_TIME']) {
$cacheDataCollector->restrictMaximumLifetime($midnightTime - $GLOBALS['EXEC_TIME']);
}
With the former 24 hour default, the expiry day was always today or tomorrow, so the
cache expired at the upcoming midnight — the documented purpose of the setting. With a
one year default, the expiry day is one year ahead, so the cache now expires at midnight
roughly 365 days from now unless config.cache_period is set explicitly.
Steps to reproduce
TYPO3 14.3.6, config.cache_clearAtMidnight = 1, no config.cache_period set.
Actual: response header x-typo3-cache-lifetime: 31493211 (~364.5 days, midnight of the
same date next year).
Expected: the cache expires at the upcoming midnight.
Missing changelog
As #109054 was classified as a bugfix, there is no changelog entry. Neither integrators
nor the documentation had a chance to learn about the new default — Changelog/14.3.x/
holds 19 Important-* entries for exactly this kind of behavioural change in a patch
release.
Suggested resolution
- Decide how cache_clearAtMidnight should behave: either restrict the lifetime to the
upcoming midnight regardless of the configured cache period, or deprecate the setting
(CacheTimeout.php already carries a @todo questioning the concept because it depends on
the server timezone). - Add an Important-109054-* changelog entry to Changelog/14.3.x/ documenting the raised
default and its effect on cache_clearAtMidnight. - Update the outdated “default of 24 hours” comment in CacheLifetimeCalculator.
Originally reported on the documentation side:
https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/issues/1792
The TypoScript Reference is being corrected in
https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/pull/1813
Reviews 2
History 27
-
Gerrit Code Review pushed patch set 1 for main to change 95749 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-09T18:03:36+00:00" > 09/09/26, 18:03 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95749 <span data-processor="relativetime" data-value="2026-09-30T10:36:48+00:00" > 09/30/26, 10:36 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96222 <span data-processor="relativetime" data-value="2026-09-30T14:49:30+00:00" > 09/30/26, 14:49 </span>
-
Wouter Wolters commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-30T14:55:09+00:00" > 09/30/26, 14:55 </span> -
Gerrit Code Review pushed patch set 2 for 14.3 to change 96222 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-09-30T15:00:45+00:00" > 09/30/26, 15:00 </span> -
Gerrit Code Review pushed patch set 3 for 14.3 to change 96222 <span data-processor="relativetime" data-value="2026-09-30T15:13:19+00:00" > 09/30/26, 15:13 </span>
-
Wouter Wolters commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-09-30T16:10:10+00:00" > 09/30/26, 16:10 </span>Applied in changeset commit:a0ed4ef493b8bdda7325e9b1f0a3ebd85702be97.
Applied in changeset commit:15179e3b2b9d8aba3c3c374e63b83b7efbf58389.