findCities() { return distributorMapper.selectCities();}@Override@Cacheable(cacheNames = {"car"}, key = "key2")public List 赞 踩 @Override @Override 自定义缓存时间 distributor::key1 的有效期是永久的 car::key2 的有效期是6分钟 Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。
Redis:Spring Boot使用@Cacheable时设置部分缓存的过期时间_cacheable 保存时长
@Cacheable(cacheNames = {"distributor"}, key = "key1")
public List<CityVO> findCities() {
return distributorMapper.selectCities();
}
@Cacheable(cacheNames = {"car"}, key = "key2")
public List<CityVO> findCities() {
return distributorMapper.selectCities();
}