Ehcache in wiki example
asookazian Sep 5, 2009 7:27 AMI was looking in the examples distro to see if there are any ehcache.xml files and the wiki project (which is the basis for this web forum), had one.
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <!-- DiskStore configuration Sets the path to the directory where cache files are created. If the path is a Java System Property it is replaced by its value in the running VM. The following properties are translated: * user.home - User's home directory * user.dir - User's current working directory * java.io.tmpdir - Default temp file path Subdirectories can be specified below the property e.g. java.io.tmpdir/one --> <diskStore path="java.io.tmpdir"/> <!-- Cache configuration. The following attributes are required. name: Sets the name of the cache. This is used to identify the cache. It must be unique. maxElementsInMemory: Sets the maximum number of objects that will be created in memory maxElementsOnDisk: Sets the maximum number of objects that will be maintained in the DiskStore The default value is zero, meaning unlimited. eternal: Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. overflowToDisk: Sets whether elements can overflow to disk when the memory store has reached the maxInMemory limit. The following attributes are optional. timeToIdleSeconds: Sets the time to idle for an element before it expires. i.e. The maximum amount of time between accesses before an element expires Is only used if the element is not eternal. Optional attribute. A value of 0 means that an Element can idle for infinity. The default value is 0. timeToLiveSeconds: Sets the time to live for an element before it expires. i.e. The maximum time between creation time and when an element expires. Is only used if the element is not eternal. Optional attribute. A value of 0 means that and Element can live for infinity. The default value is 0. diskPersistent: Whether the disk store persists between restarts of the Virtual Machine. The default value is false. diskExpiryThreadIntervalSeconds: The number of seconds between runs of the disk expiry thread. The default value is 120 seconds. memoryStoreEvictionPolicy: Policy would be enforced upon reaching the maxElementsInMemory limit. Default policy is Least Recently Used (specified as LRU). Other policies available - First In First Out (specified as FIFO) and Less Frequently Used (specified as LFU) --> <!-- Mandatory Default Cache configuration. These settings will be applied to caches created programmtically using CacheManager.add(String cacheName) --> <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="600" timeToLiveSeconds="600" overflowToDisk="false" memoryStoreEvictionPolicy="LRU" /> <cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="100" eternal="false" overflowToDisk="false" timeToIdleSeconds="300" timeToLiveSeconds="600" memoryStoreEvictionPolicy="LRU"/> <cache name="org.hibernate.cache.UpdateTimestampsCache" maxElementsInMemory="1000" eternal="true" overflowToDisk="false"/> <cache name="WikiPreference" maxElementsInMemory="20000" eternal="false" overflowToDisk="false" timeToIdleSeconds="1000" timeToLiveSeconds="6000" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiLinkProtocol" maxElementsInMemory="50" eternal="false" overflowToDisk="false" timeToIdleSeconds="86400" timeToLiveSeconds="259200" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiFeed" maxElementsInMemory="100" eternal="false" overflowToDisk="false" timeToIdleSeconds="86400" timeToLiveSeconds="259200" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiFeedEntry" maxElementsInMemory="1000" eternal="false" timeToIdleSeconds="86400" timeToLiveSeconds="259200" overflowToDisk="false" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiFeedEntryCollection" maxElementsInMemory="5000" eternal="false" overflowToDisk="false" timeToIdleSeconds="86400" timeToLiveSeconds="259200" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiUser" maxElementsInMemory="5000" eternal="false" overflowToDisk="false" timeToIdleSeconds="10000" timeToLiveSeconds="60000" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiRole" maxElementsInMemory="100" eternal="false" overflowToDisk="false" timeToIdleSeconds="10000" timeToLiveSeconds="60000" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiUserRoleCollection" maxElementsInMemory="5000" eternal="false" overflowToDisk="false" timeToIdleSeconds="10000" timeToLiveSeconds="60000" memoryStoreEvictionPolicy="LRU"/> <cache name="WikiPageFragmentCache" maxElementsInMemory="500" eternal="false" overflowToDisk="false" timeToIdleSeconds="1000" timeToLiveSeconds="6000" memoryStoreEvictionPolicy="LRU"/> </ehcache>
So how exactly is 2nd level caching used in this app?