Skip to content

Commit ced25d5

Browse files
authored
cache_lifetime must be an integer or null (#417)
1 parent a07220d commit ced25d5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
# 1.xx.yy- YYYY-MM-JJ
6+
7+
- Fixed: You can now configure the cache plugin option `cache_lifetime` to `null` (which makes the plugin not add to the maxAge).
8+
59
# 1.26.1 - 2022-04-29
610

711
- Fixed: Setting the cache plugin option `respect_response_cache_directives` to `null` makes the

src/DependencyInjection/Configuration.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,14 @@ private function createCachePluginNode()
710710
->scalarNode('cache_key_generator')
711711
->info('This must be a service id to a service implementing '.CacheKeyGenerator::class)
712712
->end()
713-
->integerNode('cache_lifetime')
713+
->scalarNode('cache_lifetime')
714714
->info('The minimum time we should store a cache item')
715+
->validate()
716+
->ifTrue(function ($v) {
717+
return null !== $v && !is_int($v);
718+
})
719+
->thenInvalid('cache_lifetime must be an integer or null, got %s')
720+
->end()
715721
->end()
716722
->scalarNode('default_ttl')
717723
->info('The default max age of a Response')

0 commit comments

Comments
 (0)