|
|
|
@ -18,7 +18,8 @@ public class CacheConfig {
|
|
|
|
|
@Bean
|
|
|
|
|
public EhCacheCacheManager getCacheManager() {
|
|
|
|
|
net.sf.ehcache.config.Configuration configuration = new net.sf.ehcache.config.Configuration();
|
|
|
|
|
configuration.setMaxBytesLocalHeap("4G");
|
|
|
|
|
// todo 需根据服务器物理内存配置
|
|
|
|
|
configuration.setMaxBytesLocalHeap("1G");
|
|
|
|
|
configuration.updateCheck(false);
|
|
|
|
|
configuration.addDiskStore(new DiskStoreConfiguration().path("java.io.tmpdir"));
|
|
|
|
|
CacheManager cacheManager = CacheManager.create(configuration);
|
|
|
|
|