Comments (5)
Thanks for using go-cache! :)
from go-cache.
The stale entry won't be deleted until you manually run DeleteExpired() because the janitor is disabled, but even though the item is still there, it has expired and so is not returned.
from go-cache.
Hm, yeah, just found this after inspecting Get
- so that's intended behaviour? Sorry, I'm a bit new to caches...
Thanks for the fast response, btw : D
from go-cache.
"janitor" isn't really a general cache concept, but yes, generally caches don't return an item that has expired, even if it's still pending cleanup (which is what the janitor does at regular intervals.)
from go-cache.
Okai, thanks for the explanation!
from go-cache.
Related Issues (20)
- Question HOT 1
- please create a new tag HOT 1
- sync.runtime_SemacquireMutex(0xc02c98fbf0?, 0x1f?, 0x3?) HOT 2
- Feature request: Renaming HOT 3
- Recommend a new go-cache package
- why dont exported shardedCache struct? HOT 1
- Question: why Get() function can't unlock immediately?like this: HOT 2
- cache will not expire when system time drift backward
- Float calculation error
- Question About Expired
- goroutine leak at cache.go:1079 - `runJanitor` HOT 5
- Example how to save cache in file and reload using gob an c.Items() ? HOT 1
- The efficiency of `Get` will decrease if too many `Set ` are executed HOT 1
- Introduce pattern-based Keys and Scan functions
- Proposal to Integrate SIEVE Eviction Algorithm
- support generic
- incompatibility Issue
- OnEvicted is not called for every expired value HOT 1
- go incompatible version HOT 3
- Multiple caches, one metric HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-cache.