bluele / gcache

An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

allow to store value in file and not memory

vtolstov opened this issue · comments

I want to use this package to ARC cache for some massive read/write app but value in my case is big > 4M does it possible to store values in files and keys in memory?

That feature request won't make it to master. It's not really what this library is trying to achieve (being an in-memory, extensible cache library).

With that said, you could consider using an ARC cache to manage your keys and use the underlying filesystem if that's what you want to do. GCache lets you define evict hooks such that removing a file when the corresponding key gets kicked-out should be easy. There are some inefficiencies involved in this hack/solution but I leave it to you to figure if those are tolerable.

If you provide more information I might be able to help you. Good luck!