使用CacheRefresh註解即可開啓緩存:
//使用緩存 緩存時長:30分鐘
@Cached(cacheType = CacheType.LOCAL, expire = 30, timeUnit = TimeUnit.MINUTES)
//自動刷新緩存 30分鐘刷新一次緩存
@CacheRefresh(refresh = 30, timeUnit = TimeUnit.MINUTES)
public Response get(){
xxxxxx
}
使用CacheRefresh註解即可開啓緩存:
//使用緩存 緩存時長:30分鐘
@Cached(cacheType = CacheType.LOCAL, expire = 30, timeUnit = TimeUnit.MINUTES)
//自動刷新緩存 30分鐘刷新一次緩存
@CacheRefresh(refresh = 30, timeUnit = TimeUnit.MINUTES)
public Response get(){
xxxxxx
}