-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e34395
commit b62ce4a
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
leecx-mng/leecx-mng-web/src/main/resources/shiro/ehcache-shiro.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ehcache updateCheck="false" name="shiroCache"> | ||
|
||
<diskStore path="C:\shiro\ehcache" /> | ||
<!-- <diskStore path="java.io.tmpdir"/> --> | ||
|
||
<!-- | ||
eternal:缓存中对象是否为永久的,如果是,超时设置将被忽略,对象从不过期。 | ||
maxElementsInMemory:缓存中允许创建的最大对象数 | ||
overflowToDisk:内存不足时,是否启用磁盘缓存。 | ||
timeToIdleSeconds:缓存数据的钝化时间,也就是在一个元素消亡之前, 两次访问时间的最大时间间隔值,这只能在元素不是永久驻留时有效,如果该值是 0 就意味着元素可以停顿无穷长的时间。 | ||
timeToLiveSeconds:缓存数据的生存时间,也就是一个元素从构建到消亡的最大时间间隔值,这只能在元素不是永久驻留时有效,如果该值是0就意味着元素可以停顿无穷长的时间。 | ||
memoryStoreEvictionPolicy:缓存满了之后的淘汰算法。 | ||
diskPersistent:设定在虚拟机重启时是否进行磁盘存储,默认为false | ||
diskExpiryThreadIntervalSeconds: 属性可以设置该线程执行的间隔时间(默认是120秒,不能太小 | ||
1 FIFO,先进先出 | ||
2 LFU,最少被使用,缓存的元素有一个hit属性,hit值最小的将会被清出缓存。 | ||
3 LRU,最近最少使用的,缓存的元素有一个时间戳,当缓存容量满了,而又需要腾出地方来缓存新的元素的时候,那么现有缓存元素中时间戳离当前时间最远的元素将被清出缓存。 | ||
--> | ||
<defaultCache | ||
maxElementsInMemory="10000" | ||
eternal="false" | ||
timeToIdleSeconds="120" | ||
timeToLiveSeconds="120" | ||
overflowToDisk="false" | ||
diskPersistent="false" | ||
diskExpiryThreadIntervalSeconds="120" | ||
/> | ||
|
||
<cache name="activeSessionCache" | ||
maxElementsInMemory="10000" | ||
eternal="true" | ||
overflowToDisk="false" | ||
diskPersistent="true" | ||
diskExpiryThreadIntervalSeconds="600"/> | ||
|
||
<cache name="shiro.authorizationCache" | ||
maxElementsInMemory="100" | ||
eternal="false" | ||
timeToLiveSeconds="600" | ||
overflowToDisk="false"/> | ||
|
||
</ehcache> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters