Are you using a clustered cache by chance, for example replicated? Unfortunately max-idle only works reliably in a single node. This is due to a get sometimes is only performed locally. So this means that other nodes may not be refreshed and the key may expire on a subset of nodes. Therefore, for consistency it is not recommended to use max-idle in a clustered cache .
Thanks for your reply.
In production, yes I am using clustered cache but the test I performed was on a single node.
I am using Version 8.1.x & as per your documentation "
this entry will expire 1000 millis after it is last accessed" when there is a configuration for Max-idle.
Does the word "accessed" also include "GET" operation when only single node is in use?