jellydator / ttlcache

An in-memory cache with item expiration and generics
MIT License
883 stars 115 forks source link

Add `Version()` method #101

Closed gozeloglu closed 1 year ago

gozeloglu commented 1 year ago
gozeloglu commented 1 year ago

Hi @swithek. Can you review the last changes?

davseby commented 1 year ago

Should we increment the version in case the item was only fetched (e.g Get method with TTL on)? I think it would have more use cases if it was updated only when the value is modified. @swithek

swithek commented 1 year ago

I wasn't sure about that either, but I think you're right. It makes more sense if only the version of the value is tracked (i.e., no need to update the version number in touchUnsafe).

cc @gozeloglu

gozeloglu commented 1 year ago

Sorry for the late response and changes. I hope I understood correctly your concerns. Please have a look and let me know if something is wrong or missing.

@swithek @davseby