Administer > Dynamic caching > WebSphere Commerce data cache
Enable WebSphere Commerce data cache
Each kind of data cached by the WebSphere Commerce data cache can be configured using one of two possible configuration methods: command caching or defining distributedMap objects.
When you use command caching, you can choose which kinds of data will be cached, and to fine tune the configuration by changing the <cache-entry> element attributes, such as <priority>, <timeout>, and <inactivity>. For more information, see cachespec.xml.
The WebSphere Commerce data cache can be configured to use DistributedMap object caches, by defining specially named.object caches in the cacheinstances.properties file. (Refer to Administering, Dynamic caching, WebSphere Commerce data cache.)
Procedure
- Command caching
If you already have cache entry tags defined in the Stores cachespec.xml file, you might need to measure throughput, CPU usage, and memory usage, and adjust priority, timeout, and inactivity tags to obtain the best performance.
- Open the sample cache configuration file cachespec.xml located...
- WCDE_INSTALL\samples\dynacache\
- WC_INSTALL\samples\dynacache\
- Copy <cache-entry> elements from the sample cache configuration file to the cachespec.xml file found...
- WC_EAR\Stores.war\WEB-INF\
- WC_EAR\Stores.war\WEB-INF\
- Use object caching in specified DistributedMap instances causes each kind of data to be cached in its corresponding DistributedMap object. When you use this method, the cachespec.xml configurations are not used for the kinds of data that have a corresponding DistributedMap defined. For those kinds of data, you cannot fine tune the priority, timeout, or inactivity settings using the cachespec.xml configuration file, but you can specify other DistributedMap attributes, such as the maximum number of cache entries to be used by each DistributedMap. For more information about the cacheinstances.properties file format, see Use the DistributedMap and DistributedObjectCache interfaces for the dynamic cache.
There are two ways you can define DistributedMap objects:
- Define DistributedMap objects with the default JNDI names found in the cacheinstances.properties file located...
- WCDE_INSTALL\samples\dynacache\
- WC_INSTALL\samples\dynacache\
You can copy and paste selected contents of the samples\dynacache\cacheinstances.properties file into the custom cacheinstances.properties file in the Stores.war\WEB-INF\classes directory.
- Use the WebSphere Application Server Integrated Solutions Console. From the left menu, click Resources > Cache instances > Object cache instances
- Object cache instances defined in the cacheinstances.properties files should set the corresponding properties for each cache instance.
Property Name Value cache.instance.n.cacheSize start with the size in the sample cacheinstances.properties file cache.instance.n.enableDiskOffload start with false cache.instance.n.flushToDiskOnStop start with false cache.instance.n.disableDependencyId false cache.instance.n.useListenerContext false cache.instance.n.enableCacheReplication specify true if you have defined a replication domain cache.instance.n.replicationType 1 cache.instance.n.replicationDomain your replication domain name cache.instance.n.filterLRUInvalidation true cache.instance.n.filterTimeOutInvalidation true cache.instance.n.disableTemplatesSupport true cache.instance.n.ignoreValueInInvalidationEvent true cache.instance.n.useServerClassLoader true
- Configure an object cache to use the WebSphere eXtreme Scale service provider. Object cache instances defined in the cacheinstances.properties files should set the corresponding properties for each cache instance.
Property Name Value cache.instance.n.cacheSize start with the size in the sample cacheinstances.properties file cache.instance.n.enableDiskOffload false cache.instance.n.flushToDiskOnStop false cache.instance.n.disableDependencyId false cache.instance.n.useListenerContext false cache.instance.n.enableCacheReplication true cache.instance.n.replicationType 1 cache.instance.n.filterLRUInvalidation true cache.instance.n.filterTimeOutInvalidation true cache.instance.n.disableTemplatesSupport true cache.instance.n.ignoreValueInInvalidationEvent true cache.instance.n.useServerClassLoader true cache.instance.n.com.ibm.websphere.xs.dynacache.disable_recursive_invalidate true cache.instance.n.com.ibm.websphere.xs.dynacache.ignore_value_in_change_event true cache.instance.n.com.ibm.websphere.xs.dynacache.enable_compression true cache.instance.n.com.ibm.websphere.xs.dynacache.topology remote
Related concepts
Additional WebSphere Commerce data cache configuration
Related reference
Logical cache names and the DistributedMaps they use by default
Access bean classes extended to take advantage of WebSphere Commerce data cache
Data bean classes extended to take advantage of WebSpere Commerce data cache