Using the list-rendering cache | HCL Digital Experience

The Digital Data Connector (DDC) for HCL Portal framework allows to cache large fragments of the markup generated by your lists.

About this task

The markup fragments are cached in the com.ibm.workplace.wcm.pzn.plr.ListRenderingCache. To use this cache, you apply the ListRenderingCache rendering plug-in. It uses the HCL Web Content Manager design components involved in the markup generation for this cache. Proceed as follows:

Procedure

  1. Enable the com.ibm.workplace.wcm.pzn.plr.ListRenderingCache cache.
    You configure the cache in the WP Cache Manager Service resource environment provider in the WebSphere® Integrated Solutions Console. For more information, read the Portal service configuration and Setting service configuration properties.
  2. To make your list markup cacheable in the list rendering cache, you add the ListRenderingCache plug-in in the following four places in your list designs:
    1. In your presentation template, render the appearance component by using the following code:
      [Plugin:ListRenderingCache action="render" elementName=""]
      When you render the appearance component by 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 that the Social Lists 1.0 library contains.
    2. At the beginning of the header of your appearance component, initialize the cache key by using the following code:
      [Plugin:ListRenderingCache action="start" compute="once" 
           currentPage="[PageInfo value='currentPage']" 
           itemsPerPage="[PageInfo value='itemsPerPage']"]
    3. At the beginning of the Result design of your appearance component, initialize a new item in the list by using the following code:
      [Plugin:ListRenderingCache action="renderItem" 
           index="[Placeholder tag='listnum']" compute="always"]
    4. At the beginning of the footer of your appearance component, finalize the cache value by using the following code:
      [Plugin:ListRenderingCache action="stop"]

Results

Using the list rendering cache as described here can improve performance by caching fully rendered markup fragments.
Notes:
  • The ListRenderingCache plug-ins cache the cached markup only if you enabled the ListRenderingCache. Rendering the list on a cache hit can then be faster than with the ListRenderingCache disabled.
  • If you 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 you use the list rendering cache, you 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. If you want to improve performance even more, you 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=""]