package cn.pluss.platform.aop.cache;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

@Configuration
/**
 * @功能描述 内存缓存
 * 
 */
public class UrlCache {
    @Bean
    public Cache<String, Integer> getCache() {
        return CacheBuilder.newBuilder().expireAfterWrite(5L, TimeUnit.SECONDS).build();// 缓存有效期为5秒
    }
}