Skip to content

Commit

Permalink
cache_lifetime must be an integer or null (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
VirgileZol authored Jun 1, 2022
1 parent a07220d commit ced25d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ced25d5

Please sign in to comment.