diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index aa1ebdc..f844e13 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -214,6 +214,8 @@ protected function doSetMultiple(array $items) { 'tags' => array(), ); + // Ensure that the cache item respects the max_lifetime configuration when + // set and the item has a longer expiration time. if ($expire !== Cache::PERMANENT && ($item['expire'] === Cache::PERMANENT || $item['expire'] > $expire)) { $item['expire'] = $expire; } diff --git a/core/modules/system/src/Tests/Cache/DatabaseBackendUnitTest.php b/core/modules/system/src/Tests/Cache/DatabaseBackendUnitTest.php index c0ca619..4feddcd 100644 --- a/core/modules/system/src/Tests/Cache/DatabaseBackendUnitTest.php +++ b/core/modules/system/src/Tests/Cache/DatabaseBackendUnitTest.php @@ -59,7 +59,6 @@ public function testCacheBinExpiration() { $backend->set('test_cache1', 'foo'); $cached = $backend->get('test_cache1'); - debug($cached->expire); $this->assertIdentical($cached->expire, (string) (REQUEST_TIME + 2800), 'Maximum cache expire time is correct.'); $backend->set('test_cache2', 'foo', REQUEST_TIME + 2799); diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index c1c0adf..af187d6 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -688,9 +688,9 @@ * collected after the configured time, and will need to be rebuilt if the * item is requested again. */ - $settings['cache_database']['render'] = [ - 'max_lifetime' => 86400 * 7, - ]; +# $settings['cache_database']['render'] = [ +# 'max_lifetime' => 86400 * 7, +# ]; /**