muesli / cache2go

Concurrency-safe Go caching library with expiration capabilities and access counters
Other
2.11k stars 518 forks source link

how about expire an item on the timestamp being added into the table other then the last time being accessed #45

Open datainsect opened 4 years ago

datainsect commented 4 years ago

how about expire an item on the timestamp being added into the table other then the last time being accessed.

bazingame commented 4 years ago

I support your idea. I have some scene to need to use cache like your description. I want to let the cache expire at (item.createdOn + item.lifeSpan). I hope at least set one option to let us to choose expire rules. I sincerely hope author can think about this.