Use the list-rendering cache
The IBM Digital Data Connector framework allows to cache large fragments of the markup generated by the lists.
The markup fragments are cached in the com.ibm.workplace.wcm.pzn.plr.ListRenderingCache. To use this cache, we apply the ListRenderingCache rendering plug-in. It uses the Web Content Manager design components involved in the markup generation for this cache...
- Enable the com.ibm.workplace.wcm.pzn.plr.ListRenderingCache cache. We configure the cache in the WP Cache Manager Service resource environment provider in the WAS console. For more information, read the Portal service configuration and Setting service configuration properties.
- To make the list markup cacheable in the list rendering cache, you add the ListRenderingCache plug-in in the following four places in the list designs:
- In the presentation template, render the appearance component using the following code:
[Plugin:ListRenderingCache action="render" elementName=""]
When we render the appearance component using the ListRenderingCache plug-in, specify the name of the component reference defined in the current content item that holds the reference to the appearance component. For a full example, view the Cached List of Social Objects presentation template and the Comprehensive and Simple list appearance components the Social Lists 1.0 library contains.
- At the beginning of the header of the appearance component, initialize the cache key using the following code:
[Plugin:ListRenderingCache action="start" compute="once" currentPage="[PageInfo value='currentPage']" itemsPerPage="[PageInfo value='itemsPerPage']"]
- At the beginning of the Result design of the appearance component, initialize a new item in the list using the following code:
[Plugin:ListRenderingCache action="renderItem" index="[Placeholder tag='listnum']" compute="always"]
- At the beginning of the footer of the appearance component, finalize the cache value using the following code:
[Plugin:ListRenderingCache action="stop"]
Results
Use the list rendering cache as described here can improve performance on cache hits.
- The ListRenderingCache plug-ins cache the cached markup only if we enabled the list-rendering cache.
- If we disable the ListRenderingCache, caching is not active, but all markup generated between the start and the stop action on the ListRenderingCache plugin is rendered normally.
When we use the list rendering cache, we can still have context dependent data in the markup. By default, all values of non-lazy computed item attributes and list properties are not cached with the markup, but recomputed with every rendering. This way, state dependent data, for example stateful portal URLs, continue to work as expected. To improve performance even more, we can cache the full markup. To do so add a type="static" parameter to the render action as follows:
[Plugin:ListRenderingCache action="render" type="static" elementName=""]
Parent Digital Data Connector cache tuningRelated tasks:
Set service configuration propertiesRelated reference:
Portal service configuration