diff --git a/CHANGELOG.md b/CHANGELOG.md index 056032d2..4636f6f1 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 option `cache_lifetime` to `null` (which makes the plugin not add to the maxAge). + # 1.26.1 - 2022-04-29 - Fixed: Setting the cache plugin option `respect_response_cache_directives` to `null` makes the diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index fe846b0d..2d7b7e5e 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -710,8 +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') + ->validate() + ->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')