-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eviction not perform after timeout #31
Comments
You got us :) We are really lazy and eviction is performed only when new item is inserted. If you try to obtain value from cache and it should be evicted but nothing was inserted you will get your value. |
Yes ,I known your eviction design after reading your blog. So my testing code already call a cache set action after timeout. And then try to query timeouted entry. // Eviction is performed during writes to the cache since the lock is already acquired. |
You are correct. The problem is we only delete oldest entry from shard where we are going to insert new value. In your example you have 1024 shards and values get into different shards. I've prepared test for this case: #33 |
I'm trying to support expiration in #41, and PTAL. |
Yes that would help others. |
@janisz , In my project I need to ensure that keys are evicted after fixed time interval. I got your point that we need to set a new key to evict, but where should I write the code to add the new entry so that it evicts old entries. Does this set operation evict only one old entry? |
I am new to golang and looking for a cache library.
after read your blog, I write a small code for study cache set/get/expire. Now I have a issue, expire not working after timeout. still can get entry from bigcache. Did I missing something?
The text was updated successfully, but these errors were encountered: