Configure cachespec.xml file for cache replication

The global replication configuration specified in the previous section applies for all caching objects unless the cachespec.xml configuration specifies otherwise. Every entry in cachespec.xml can use the <sharing-policy> element, with the values specified below. If the <sharing-policy> element is not present, the global settings are used.

The sharing policy on the cache entry level can have the same values as can be defined on the global level:
not-shared
shared-push
shared-pull
shared push-pull

Example 14-10 shows the marketSummary.jsp entry in cachespec.xml. This JSP will be cached and replicated based on the global settings because the <sharing-policy> element has not been specified.

Example 14-10 Replication setting for marketSummary.jsp

cache-entry>
	<class>servlet</class>
	<name>/marketSummary.jsp</name>
	<property name="EdgeCacheable">true</property>
	<cache-id>
		<priority>3</priority>
		<timeout>180</timeout>
	</cache-id>
	<dependency-id>MarketSummary
	</dependency-id>
</cache-entry>

Example 14-11 contains an entry for MarketSummaryComand. This command result will not be replicated, because the sharing-policy element value explicitly specifies that this object cannot be shared among different appservers.

Note Even though this entry is not shared, in a replicated environment, invalidations are still sent.

Example 14-11 Replication setting for MarketSummaryCommand

<cache-entry>
	<class>command</class>
	<sharing-policy>not-shared</sharing-policy>
	<name>com.ibm.websphere.samples.trade.command.MarketSummaryCommand</name>		
	<cache-id>
		<priority>3</priority>
		<timeout>10</timeout>
	</cache-id>
	<dependency-id>MarketSummary
	</dependency-id>			
</cache-entry>

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.