GCache
一个轻量级,高性能的缓存构架,以android缓存而设计为初衷,也可以应用于一般的Java项目中。
Install / Use
/learn @tonybase/GCacheREADME
GCache
一个轻量级,高性能的缓存构架,以android缓存而设计为初衷,也可以应用于一般的Java项目中。
======
DiskWithMemoryCache:
GCache cache = Builders.newBuilder()
.withTranscoder(new StringTranscoder())
.withCacheRootDirectory(new File("diskCache"))
.maxDiskUsageBytes(10000)
.maxMemoryUsageBytes(1000)
.defaultCacheTime(50)
.build();
MemoryCache:
GCache cache = Builders.newBuilderForMemory()
.withTranscoder(new StringTranscoder())
.maxMemoryUsageBytes(10000)
.defaultCacheTime(20)
.build();
DiskBasedCache:
GCache cache = Builders.newBuilderForDisk()
.withTranscoder(new StringTranscoder())
.withCacheRootDirectory(new File("diskCache"))
.maxDiskUsageBytes(1000)
.defaultCacheTime(50)
.build();
cache.put(K, V); //use defaultCacheTime
cache.put(K, V, TTL);
cache.get(K);
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
