From c734318a150fd01d0a65458bc9af809e603e9639 Mon Sep 17 00:00:00 2001 From: VirgileZol <23308833+VirgileZol@users.noreply.github.com> Date: Tue, 31 May 2022 17:40:53 +0200 Subject: [PATCH 1/5] cache_lifetime must be an integer or null --- src/DependencyInjection/Configuration.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index fe846b0d..35116231 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -710,9 +710,14 @@ private function createCachePluginNode() ->scalarNode('cache_key_generator') ->info('This must be a service id to a service implementing '.CacheKeyGenerator::class) ->end() - ->integerNode('cache_lifetime') + ->scalarNode('cache_lifetime') ->info('The minimum time we should store a cache item') - ->end() + ->validate() + ->ifTrue(function ($v) { + return null !== $v && !is_int($v); + }) + ->thenInvalid('cache_lifetime must be an integer or null, got %s') + ->end() ->scalarNode('default_ttl') ->info('The default max age of a Response') ->validate() From b70c8b15e7041b9f23d40d3ddfd0aaa19a64b594 Mon Sep 17 00:00:00 2001 From: VirgileZol <23308833+VirgileZol@users.noreply.github.com> Date: Tue, 31 May 2022 17:51:09 +0200 Subject: [PATCH 2/5] Update Configuration.php --- src/DependencyInjection/Configuration.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 35116231..56d7fbc4 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -725,7 +725,6 @@ private function createCachePluginNode() return null !== $v && !is_int($v); }) ->thenInvalid('default_ttl must be an integer or null, got %s') - ->end() ->end() ->arrayNode('blacklisted_paths') ->info('An array of regular expression patterns for paths not to be cached. Defaults to an empty array.') From fd31b3ee8cc42f1c0db2525ff7dc49e5c1936c8a Mon Sep 17 00:00:00 2001 From: VirgileZol <23308833+VirgileZol@users.noreply.github.com> Date: Tue, 31 May 2022 18:21:58 +0200 Subject: [PATCH 3/5] Update Configuration.php --- src/DependencyInjection/Configuration.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 56d7fbc4..2d7b7e5e 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -713,11 +713,12 @@ private function createCachePluginNode() ->scalarNode('cache_lifetime') ->info('The minimum time we should store a cache item') ->validate() - ->ifTrue(function ($v) { - return null !== $v && !is_int($v); - }) - ->thenInvalid('cache_lifetime must be an integer or null, got %s') + ->ifTrue(function ($v) { + return null !== $v && !is_int($v); + }) + ->thenInvalid('cache_lifetime must be an integer or null, got %s') ->end() + ->end() ->scalarNode('default_ttl') ->info('The default max age of a Response') ->validate() @@ -725,6 +726,7 @@ private function createCachePluginNode() return null !== $v && !is_int($v); }) ->thenInvalid('default_ttl must be an integer or null, got %s') + ->end() ->end() ->arrayNode('blacklisted_paths') ->info('An array of regular expression patterns for paths not to be cached. Defaults to an empty array.') From 7806320ffc85637fa3a311238d7b8bef3492cea6 Mon Sep 17 00:00:00 2001 From: VirgileZol <23308833+VirgileZol@users.noreply.github.com> Date: Tue, 31 May 2022 18:26:12 +0200 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 056032d2..0a0bb2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +# 1.xx.yy- YYYY-MM-JJ + +- Fixed you can now configure the cache plugin cache_lifetime with `null`. + # 1.26.1 - 2022-04-29 - Fixed: Setting the cache plugin option `respect_response_cache_directives` to `null` makes the From 4429ec9ac1e274c6e4e00eafdfb44b94c3966f92 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 1 Jun 2022 08:05:15 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0bb2d2..4636f6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee # 1.xx.yy- YYYY-MM-JJ -- Fixed you can now configure the cache plugin cache_lifetime with `null`. +- Fixed: You can now configure the cache plugin option `cache_lifetime` to `null` (which makes the plugin not add to the maxAge). # 1.26.1 - 2022-04-29