In above example, It cache the token data but expiration time is not fixed.
So is there any way to passed expire time in cache:get() function or you @all have any other suggestion for delete the cache after specific time?
@thibaultcha,
Hello,
kong.singletons is resurrecting a stale item from the cache from shm even there is no resurrect_ttl is specified.
How to avoid this behavior?
if I need to declare my own mlcacahe instance to avoid this ( by not specifiying resurrect_ttl), what is the best way to inject in to kong’s init so this mlcache instance is shared across all the workers.
Hi, @rsvenkatesh, next time please consider opening a new thread instead of asking a new question in an old one - it’s easier to discover for others this way.
In case you are still having that problem: the default value for resurrect_ttl can be controlled globally by changing the relevant config option in the config file:
If you want to tweak the ressurect_ttl value for an individual request, leaving the rest unaltered, you can also do that by using the options parameter, the same way as with the ttl:
I have tried with resurrect_ttl = 0 already, that doesn’t seems to help. Only way is not even mentioning resurrect_ttl. After I have instance of mlcache without specifying anything to resurrect_ttl, things seems to work as expected.