Main Home: Royalcyber.com  |  Tel: +1.630.355.6292   |  Global Offices  

Troubleshooting common Caching Issues

Is there a way in which we can invalidate cache for a particular Application object and Resource collection on demand through portlets ?

Yes, If you are using the Application object in a visibility rule then disabling the visibility rule cache should address this issue.

These are the methods that you could use to invalidate the entire visibility rule cache or a particular rule within the visibility rule cache

com.ibm.websphere.personalization.transformation.PznTransformationModel.
invalidate(request, rulename)

Where:
-request is the PortletRequest and
-ruleName is a String relative to the Personalization Workspace. ( RULESWORKSPACE).

public static void invalidate(HttpServletRequest req) – Invalidates all visibility rule caching for the current user

public static void invalidate(HttpServletRequest req, String rule) –
Invalidates visibility cache for the rule specified for the current user

You might need to programmatically flush the Personalization cache, for example when a resource is updated outside of Personalization rules through some other application. A programming interface is provided to flush the cache. Since the timeout interval for the cache can be specified in the PersonalizationService.properties file, in many cases it may be adequate to wait for the cache timeout before updates are seen.

The class com.ibm.websphere.personalization.resources.cache.CacheManager can be used to invalidate the cache for a particular resource, a particular resource collection, or the entire cache. Personalization uses this class internally to flush the cache when updates occur.

Flushing the cache for a particular resource may require that all cached queries be flushed. Flushing the cache on a collection may flush the cache for all collections using the same dynamic cache map. When the application frequently flushes the cache for a particular collection, isolating that collection in its own cache map through the use of the ruleEngine.cache.jndiName.resourceCollectionName property will result in better cache utilization.

Caching occurs before any rule exits are called.

For more information about using the DistributedMap and DistributedObjectCache interfaces for the dynamic cache, refer to the IBM WebSphere Application Server Information Center.

http://publib.boulder.ibm.com/infocenter/wcmdoc/v6r0/index.jsp?topic=/com.ibm.lotus.wcm.doc/pzn/pzn_resource_cache.html

Does Caching need to be disabled at the master level in order to disable any particular resource collection?

You don’t have to disable the master level caching at rulesEngine.cache.enabled = false as it will cause performance impact.

A sample is as follows

rulesEngine.cache.enabled./.personalization/collections/ibmpzn\:wcmWebContentCollection=true
rulesEngine.cache.timeout./.personalization/collections/ibmpzn\:wcmWebContentCollection=1800
rulesEngine.cache.jndiName./.personalization/collections/ibmpzn\:wcmWebContentCollection=services/cache/distributedmap
rulesEngine.cache.priority./.personalization/collections/ibmpzn\:wcmWebContentCollection=1
rulesEngine.cache.maxEnumSize./.personalization/collections/ibmpzn\:wcmWebContentCollection=250

The resource collection that is cached is wcmWebContentCollection and it is being cached under the default distributedMap dynacache instance

Another good resource is
(Page visibility rules and unreachable Search results)
http://www-10.lotus.com/ldd/portalwiki.nsf/dx/page-visibility-rules-and-
unreachable-search-results

In a scenario in which data fetched by the resource collection is liable to change at runtime within the same session and same goes for the application object as well. What is the best practice to be followed with respect to performance without Compromising the functionality ?

You could always invalidate the cache for a particular rule.
com.ibm.websphere.personalization.resources.cache.CacheManager can be used to invalidate the cache for a particular resource, a particular resource collection, or the entire cache. Personalization uses this class internally to flush the cache when updates occur.

Can we set the personalization visibility rule to a mode like NOT_SHARED for the Dynacache implementation? If so, how is this set and should it be set?

Visibility rules cache is per session, so that does not use dynacache.

Posted in Faqs

 

cont-us-btn

 

Copyright © 2002-2018 Websphereportalguru.com. All Rights Reserved.