Spring + ecache
来源:互联网 发布:yii框架数据库查询 编辑:程序博客网 时间:2024/04/29 19:10
applicationxml
<!-- 启用缓存注解功能 -->
<cache:annotation-driven cache-manager="ehcacheManager"/>
<bean id="ehcacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:spring/cache/ehcache.xml" />
</bean>
<bean id="ehcacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcacheManagerFactory" />
</bean>
ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false">
<!-- 指定一个文件目录,当EhCache把数据写到硬盘上时,将把数据写到这个文件目录下 -->
<diskStore path="java.io.tmpdir"/>
<!-- 设定缓存的默认数据过期策略 -->
<defaultCache
maxElementsInMemory="10000"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="10"
timeToLiveSeconds="20"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"/>
<cache name="projectCache"
maxElementsInMemory="1000"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="10"
timeToLiveSeconds="20"/>
</ehcache>
pom
<dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId> <version>2.10.4</version></dependency>
demo
@CacheEvict(value = "projectCache",allEntries = true)
@Cacheable(value = "projectCache", key = "'projectCache_'+#projectName")
- Spring + ecache
- Ecache整合spring,使用页面、对象缓存
- 基于spring的ecache的配置
- ecache 详解
- Ecache 缓存
- Ecache入门
- Ecache配置文件
- 分布式Cache ecache
- ecache和redis缓存
- Ecache用法1
- ecache的简单配置使用
- SpringMVC集成Ecache缓存配置
- Springboot集成ecache缓存配置
- ecache并发缓存文件破坏异常
- ecache页面缓存问题及处理
- 利用ecache实现自定义缓存框架
- ecache控制标签放在service还是dao层
- Win7无法启动,缺少系统文件ecache.sys怎么办
- 中继器、集线器、网桥、交换机、路由器和网关
- 整数与浮点数的表示
- try{} catch{} finally{} 语句注意事项总结
- c# List转换为Json
- linux修改ssh端口
- Spring + ecache
- springmvc+jsp/html 前后台交互(一):配置多视图解析器
- Unity UGUI 九宫格
- alize使用参考
- POJ-3140 Contestants Division(树dp)
- MySQL优化系列之查询优化
- iOS 指定页面允许旋转/ 指定页面强制横屏
- 201604-1折点计数
- MySQL索引原理及慢查询优化