Skip to content

Client side caching eviction policy #455

Answered by rueian
arindamnayak asked this question in Q&A
Discussion options

You must be logged in to vote

Sure!

rueidis/lru.go

Lines 242 to 253 in 625e68a

ele = c.list.Front()
for c.size > c.max && ele != nil {
if e := ele.Value.(*cacheEntry); e.val.typ != 0 { // do not delete pending entries
kc := e.kc
if delete(kc.cache, e.cmd); len(kc.cache) == 0 {
delete(c.store, kc.key)
}
c.list.Remove(ele)
c.size -= e.size
}
ele = ele.Next()
}

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@arindamnayak
Comment options

@rueian
Comment options

Answer selected by arindamnayak
@rueian
Comment options

@arindamnayak
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants