配置項(xiàng) |
含義 |
可選值 |
缺省值 |
cache.memory |
是否進(jìn)行內(nèi)存緩存 |
true、false |
true |
cache.capacity |
內(nèi)存緩存容納的最大對象數(shù) |
整數(shù) |
不限制(指定負(fù)數(shù)也相當(dāng)于不限制),也就是緩存的對象從不被清除 |
cache.algorithm |
缺省的運(yùn)算規(guī)則。要指定運(yùn)算規(guī)則,就必須指定有效的cache.capacity值(正整數(shù))。規(guī)則是一些類,在包com.opensymphony.oscache.base.algorithm下 |
LRUCache(最近使用)、
FIFOCache(先進(jìn)先出)、
UnlimitedCache(不限制) |
不限制cache.capacity時(shí)為UnlimitedCache,
If you specify a size but not an algorithm, the cache algorithm used will be LRUCache |
cache.blocking |
當(dāng)緩存中的某條數(shù)據(jù)更新時(shí)(比如與數(shù)據(jù)庫不同步,存在不新鮮的數(shù)據(jù)),對客戶請求返回更新前的數(shù)據(jù)。這樣就提供了更好的性能。 |
true、false |
false |
cache.unlimited.disk |
硬盤緩存是否有限制。缺省為cache.capacity指定的值 |
true、false |
false |
cache.persistence.class |
做持久化操作的類名。這個(gè)類必須實(shí)現(xiàn)PersistenceListener接口,從而將緩存數(shù)據(jù)持久化到文件、數(shù)據(jù)庫、LDAP。OSCache給出一個(gè)基于文件系統(tǒng)的實(shí)現(xiàn),并且使用對象的toString()方法生成要持久化數(shù)據(jù)的文件名。HashDiskPersistenceListener和 DiskPersistenceListener要求必須同時(shí)設(shè)置cache.path屬性。 |
|
|
cache.path |
硬盤持久化時(shí)存放文件的目錄。如果目錄不存在OSCache會(huì)自動(dòng)創(chuàng)建。 |
Windows系統(tǒng):
c:\\myapp\\cache 其它: /opt/myapp/cache
|
|
cache.persistence.overflow.only* |
是否只有當(dāng)指定的內(nèi)存緩存已經(jīng)滿時(shí)才進(jìn)行持久化。推薦使用true,flase是為向后兼容。 |
true、false |
false |
cache.event.listeners |
一系列用逗號(hào)分割的類,這些類必須實(shí)現(xiàn)CacheEntryEventListener或(和)CacheMapAccessEventListener接口,CacheEntryEventListener監(jiān)聽緩存的add/update/flush/remove事件,CacheMapAccessEventListener監(jiān)聽緩存的access事件,從而可以跟蹤并統(tǒng)計(jì)緩存的執(zhí)行效率。
JavaDoc API for further details. |
|
|
cache.key |
指定在application或session范圍里緩存的對象的key,這個(gè)key被ServletCacheAdministrator(由此自定義的tags)使用。 |
|
__oscache_cache |
cache.use.host.domain.in.key |
If your server is configured with multiple hosts, you may wish to add host name information to automatically generated cache keys. If so, set this property to true |
true、false |
false |
cache.cluster.multicast.ip |
見集群的相關(guān)說明 |
|
|
cache.cluster.properties |
見集群的相關(guān)說明 |
|
|