cache-base icon indicating copy to clipboard operation
cache-base copied to clipboard

Support for TTL

Open taviroquai opened this issue 6 years ago • 3 comments

Hi,

Can't find support for TTL. Would be very usefull.

Thanks

taviroquai avatar Feb 17 '19 10:02 taviroquai

What is TTL?

jonschlinkert avatar Jan 13 '21 13:01 jonschlinkert

@jonschlinkert Hi Sorry for not adding context. I thought it would be implicit.

TTL stands for Time To Live

Would be great to add a TTL value in milliseconds as a parameter in the set method. Then when using the get method, it would automatically expire values based on time calculation.

I hope it is clear enough. What are your thoughts on this? Thank you! :)

taviroquai avatar Jan 13 '21 19:01 taviroquai

TTL stands for Time To Live

Oh, of course. I thought you meant a library or framework. Thanks for clarifying and sorry for taking so long to reply. I haven't been that active recently, but I'm planning to spend a lot more time getting libraries updated.

A PR for this would be welcome. I'd prefer no extra dependencies if possible/practical.

jonschlinkert avatar Jan 14 '21 06:01 jonschlinkert