Skip to main content

Dyna Cache

Dynacache service is an in-memory cache system that has disk offload capacity.

What is CacheSpec.xml?

The objects to be cached are specified in cachespec.xml.
Location of cachespec in toolkit\Stores\WebContent\WEB-INF
On server: \Stores.war\WEB-INF\

What can be cached? Servlet\JSP's and commands that extend from CacheableCommand interface can be cached using DynaCache.

What is DynaCache Monitor? This is an application provided by IBM for dynacache statistics, it can be installed on toolkit as well as server.

Example from cachespec for JSP\Servlet caching entries:
Servlet: .e.g. storecatalogdisplay:
<cache-id>
<component id="" type="pathinfo">
<required>true</required>
<value>/StoreCatalogDisplay</value>
</component>
<component id="storeId" type="parameter">
<value>10151</value>
<required>true</required>
</component>
<component id="catalogId" type="parameter">
<required>true</required>
</component>
<component id="langId" type="parameter">
<required>false</required>
</component>
<component id="trackingEvent" type="parameter">
<required>false</required>
</component>
<priority>30</priority>
</cache-id>
JSP: e.g. header.jsp
<cache-entry>
<class>servlet</class>
<name>ABCStorefront/include/header.jsp</name>
<property name="do-not-consume">true</property>
<property name="save-attributes">false</property>
<property name="ignore-get-post">true</property>
<sharing-policy>not-shared</sharing-policy>

<cache-id>
<component id="storeId" type="parameter">
<required>true</required>
</component>
<component id="catalogId" type="parameter">
<required>true</required>
</component>

<component id="DC_lang" type="attribute">
<required>false</required>
</component>
<component id="userImpersonated" type="parameter">
<required>false</required>
</component>
<priority>100</priority>
</cache-id>

<!-- Dependency Ids -->
<dependency-id>TTL:STAGEPROP</dependency-id>

<dependency-id>storeId
<component id="storeId" type="parameter">
<required>true</required>
</component>
</dependency-id>
<dependency-id>catalogId
<component id="catalogId" type="parameter">
<required>true</required>
</component>
</dependency-id>
<!-- Ends Dependency Ids -->
</cache-entry>
Enable Servlet caching:
1. In the administrative console, click Servers > Application servers > server_name > Web container settings > Web container in the console navigation tree.
2. Select Enable servlet caching under the Configuration tab.
3. Click Apply.
4. Restart the Server.

Performance and CPU usage: performance of the overall site and CPU usage on the app server is considerably improved with Dynacache enabled. Having a good Dynacache strategy is very important for the performance of the site. Will write another blog on that topic.

Comments

Popular posts from this blog

How to do Email Configurations in Web sphere Commerce

Web sphere commerce allows to send email messages to customers by making use of the below mentioned steps. Create the JSP which will be used for generating contents of the email  For e.g.: SendEmail.jsp Create View for the JSP in Struts-Config-Ext.xml Make an Entry in Struts-Config-Ext.xml file for .jsp as below < action path='/SendEmailView' type='com.ibm.commerce.struts.BaseAction'>     < set-property property ='authenticate' value ='10001:1'/>      < set-property property ='https' value ='10001:1'/> < /action> < forward name="SendEmailView /10001/-3" path="/< location of JSP file >/ TestEmail.jsp" className="com.ibm.commerce.struts.ECActionForward">     < set-property property="implClassName"     value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>     < set-property property="int...

How to read applied promotions codes

The below snippet will give you to read the promotions codes which are applied to order number, String orderId = "978593958"; OrderKey orderKey = new OrderKey(new Long(orderId)); PromotionArgumentSessionBeanPersistenceManager promoManager = new PromotionArgumentSessionBeanPersistenceManager(); PromotionArgument promArg = promoManager.load(orderKey); Iterator prmoExeRecds = promArg.getPromotionExecutionRecords(); while(prmoExeRecds.hasNext()) { PromotionExecutionRecord promotionExeecutionRecord = (PromotionExecutionRecord) prmoExeRecds.next(); Promotion promotion = promotionExeecutionRecord.getPromotion(); System.out.println("Name: " + promotion.getName()); System.out.println("Admin description: " + promotion.getDescription(commandContext.getLocale(), com.ibm.commerce.marketing.promotion.Description.SHOPPER_SHORT_DESC)); }

Dataload Utility

Data can be loaded into WCS tables using data load utility. WCS Data Load utility performs the following functions in a single operation: 1.                Reads the data from the input source file. 2.                Transforms the source data to Web Sphere Commerce business objects. 3.                Allocates and resolves Web Sphere Commerce business objects to physical data. 4.                Loads the physical data into the database. There are three configurations files and a input source file required to complete the data loader setup. WCS supports only CSV File Reader for other input source you have to write your own Reader Class. This means that if you are using OOB CSV Reader then your input file must be...