alibaba / jetcache

JetCache is a Java cache framework.
Apache License 2.0
5.15k stars 1.06k forks source link

如何读取Cache<String, String>的key列表,并删除指定的key #940

Open lzming9511 opened 1 month ago

lzming9511 commented 1 month ago

` public Cache<String, String> kvCache; @PostConstruct public void init() { QuickConfig kvQc = QuickConfig.newBuilder("kvCache") .expire(Duration.ofHours(72)) .cacheType(CacheType.BOTH) // 创建一个两级缓存 .localLimit(500000) // 本地缓存元素个数限制,只对CacheType.LOCAL和CacheType.BOTH有效 .build(); kvCache = cacheManager.getOrCreateCache(kvQc); }

@Async public void clearKvCacheAsync() { kvCache.removeAll(*****);//要删除所有的缓存 }

`

areyouok commented 1 month ago

没有你想要的那种接口