//配置Caffeine缓存行为(例如到期,缓存大小限制等) public Caffeine caffeineConfig() { Caffeine caffeine = Caffeine.newBuilder() .expireAfterWrite(60, TimeUnit.MINUTES) .maximumSize(1000); return caffeine; } @Bean public CacheManager cacheManager(Caffeine caffeine) { CaffeineCacheManager caffeineCacheManag...
* 用一个Caffeine实例来存放各种条件的Caffeine实例 大小按本地缓存实际使用大小设置 */ Cache<String, Cache<String, Object>> caches = Caffeine.newBuilder().initialCapacity(64).recordStats().build(); @PostConstruct public void init() { CaffeineCacheMetrics.monitor(registry, caches, "local_caches"); ...