Step 1
Extract the following two files from the portal-impl.jar (available in ROOT/WEB-INF/lib/portal-impl.jar):
- ehcache/hibernate-clustered.xml
- ehcache/liferay-multi-vm-clustered.xml
Step 2
Copy the extracted files into a custom folder, say myehcache inside the webapp classpath: ROOT/WEB-INF/classes/myehcache/.
Step 3
Update portal-ext.properties:
net.sf.ehcache.configurationResourceName=/myehcache/hibernate-clustered.xml
and:
ehcache.multi.vm.config.location=/myehcache/liferay-multi-vm-clustered.xml
Step 4
Define the new cache element in liferay-multi-vm-clustered.xml:
<cache
eternal="false"
maxElementsInMemory="10000"
name="cacheName"
overflowToDisk="false"
timeToLiveSeconds="600"
>
<cacheEventListenerFactory
class="com.liferay.portal.cache.ehcache.LiferayCacheEventListenerFactory"
properties="replicatePuts=true,replicateUpdatesViaCopy=true"
propertySeparator=","
/>
<bootstrapCacheLoaderFactory class="com.liferay.portal.cache.ehcache.LiferayBootstrapCacheLoaderFactory" />
</cache>
|