Closed 91-julian-sanchez closed 3 years ago
Hi @91-julian-sanchez,
Thanks for your help. I combined this with a related PR and added a few more things around tests. It should now be solved in the latest version 1.6.1.
Please note that setting ttlInSeconds: 0
on global cache or function cache has the same effect as setting enabled: false
. Using a boolean is the recommended way of disabling caching, because it explicitly says that caching is disabled, as opposed to having to figure that out by reading a completely different property like ttlInSeconds
.
This line
this.cacheTtlInSeconds = cachingSettings.ttlInSeconds || DEFAULT_TTL;
in ApiGatewayCachingSettings.js , Don't allows setup ttlInSeconds in zero seconds and bug detected it allows setup cacheTtlInSeconds less than zero seconds.The fix is change OR operator validation by ternary operator, like this:
this.cacheTtlInSeconds = cachingSettings.ttlInSeconds >= 0 ? cachingSettings.ttlInSeconds: DEFAULT_TTL;