Problem
In DefaultRedisCacheWriter's get method, following expression is evaluated twice
timeToIdleEnabled && withTtl ? ttl : null
Proposed Improvement
Extract the conditional TTL evaluation into a single variable
Duration ttlForGet = (timeToIdleEnabled && withTtl ? ttl : null);