Fraska Portal

Exploring the WebSphere Commerce world

WebSphere Commerce Dynacache, configuration of fragments invalidation

Posted by on in Cache
  • Font size: Larger Smaller
  • Hits: 3897
  • 22 Comments
  • Subscribe to this entry
  • Print

The invalidation is a powerful feature of Dynacache but sometimes- like in the case I'm reporting- it has its logic split between XML configuration and JSP coding.

In particular, I refer to the fragments invalidation. Let's take the following example:

  • JSP Page (root): page1.jsp
    • Fragment 1 (1st level child): fragment1.jspf
      • Fragment 2 (2nd level child): fragment2.jspf

In terms of code, page1.jsp will have something like:

...

<% out.flush() %>
<c:import file="${filedir}page1.jsp"/>
<% out.flush() %>

...

and so do fragment1.jspf. 

In addition, cachespec.xml will have the following configuration:

<class>servlet</class>
		<name>/directory/page1.jsp</name>
		<property name="do-not-consume">true</property>
		<property name="save-attributes">false</property>
		<property name="consume-subfragments">true</property>
...

The problem: despite the configuration is the IBM's InfoCenter suggested one, the fragments do not seem to be invalidated properly. In other words, when something changes in the fragments page1.jsp does not change at all.

A possible solution can be found, like I was mentioning at the beginning, from a slight change in the JSP code.

In fact, to make this scenario working properly we need to

 

#1 have the the property consume-subfragments set to true

true

 

#2 add, in the JSP fragments, the following code:

<% ((com.ibm.websphere.servlet.cache.ServletCacheResponse)response).setDoNotConsume(true); %>

 

Just in this way, when a fragment changes, the father will be invalidated.

 

Environment:

 

  • WebSphere Commerce v 7.0.0.6 FEP5
  • WebSphere Application Server 7.0.0.27
  • DB2 9.7
Rate this blog entry:
0

Comments

Leave your comment

Guest
Guest Tuesday, 22 October 2019

Most Popular Post

WebSphere Commerce, the curious life of a front-end catalog request
Core
Rate this blog entry:
5
WebSphere Commerce, the SOLR extension index
Administration
Rate this blog entry:
4
WebSphere Commerce, Data Load and SOLR Delta Index
Data Load
Rate this blog entry:
0

Latest Blogs

WebSphere Commerce, CommandLevelAuthorizationCache
Cache
Rate this blog entry:
0
WebSphere Commerce v8, toolkit exception, ClassNotFound db2
Administration
Rate this blog entry:
1
WebSphere Commerce, ATP migration
Store
Rate this blog entry:
0
WebSphere Commerce, the curious life of a front-end catalog request
Core
Rate this blog entry:
5
WebSphere Commerce, Performance analysis of few European stores
Performance
Rate this blog entry:
0