Patrick Mylund Nielsen
Patrick Mylund Nielsen
I realized I also need to be able to "flush" the cache, e.g. by allocating new arrays and replacing the ht ref or zeroing the arrays. I could ref the...
Sorry for the delay in responding. No, it's not currently possible, but that sounds reasonable. I think the easiest way will be to let you retrieve and set the underlying...
I agree it would be useful, but as it stands it would be fairly difficult as you suggest. go-cache, unlike memcached, doesn't process/serialize most of the data, but rather keeps...
Sorry for the delay. I am still thinking about how to do this nicely, namely how to evict items the best way without implementing a copy of Vitess (and the...
I like the LRU approach best but with that the concern is overhead for read-heavy loads, and the memory usage of the Ctime/Atime for each cached item. Random eviction could...
Interesting timing; this just hit HN: https://danluu.com/2choices-eviction/ We could conceivably have both options, but LRU still seems best given that we don't have a good way of selecting random items...
Please provide an example of failing code.
What exactly are you expecting to see, and what happens instead?
This is because eviction happens during the cleanup, but the value is re-set after the item has expired and before the cleanup has run. I agree this is a bug.
You don't want to return values that have expired, though. Probably the fix is to check if a value exists but has expired in the Set functions, rather than just...