-
Notifications
You must be signed in to change notification settings - Fork 593
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
What happens when I set CleanWindow = 0 ? No cache will be cleared but will LifeWindow entries... #273
Comments
You are partially correct. It might look redundant but there was a valid use case for it #31 (comment) |
would be great if the doc on the Here is my current setting:
Issue: Our desire is to have a And, this code made me very confusing: https://github.com/allegro/bigcache/blob/master/bigcache.go#L101 after verified with below test case, easy to catch:
Test Code
|
It's not deleted but evicted. Lines 34 to 35 in 0b306aa
Have you tried reading it with Lines 139 to 146 in 982ec3b
|
I'm running into the same problem. I'm looking to have a forever in-memory cache, but keys are getting removed even when Life window, Clean window and Hard max cache size are set to 0, 0 and 0 respectively. How do I go about this? |
Have you tired to set life window to max int? |
yes, that resolves the issue. Would this guarantee a forever in-memory cache? |
I'd say yes but I think we should add more explicit way of saying that entries should never expire. Maybe new config option or treat Lines 284 to 289 in 982ec3b
|
yea that would be very helpful. Thanks for the help. Also, I noticed that the keys were being removed only sometimes when Life window, Clean window and Hard max cache size were set to 0, 0 and 0 respectively. Why was that not consistent? |
That's interesting? Are you sure it was how could it be reproduced? |
yes, I executed the same code both locally and on a remote instance. The local cache worked, but the remote one ran into the key removal issue and this was consistent. |
What happens when I set CleanWindow = 0 ? No cache will be cleared but will LifeWindow entries be able to Get?
Is CleanWindow a bit redundant? it's ok to leave expired entries in LifeWindow right? It just sits there and will not be gotten out.
The text was updated successfully, but these errors were encountered: