By default, the social list cache is disabled. You can globally enable and tune it by adjusting the corresponding cache configuration in the WP Cache Manager Service resource environment provider in the WebSphere
® Integrated Solutions Console. If you globally enable the social list cache, you can still enable or disable it separately for each individual social list. To do this, you use the social list cache rendering plug-in, which is described in the following.
If you enable the social list cache, and if your website designers update design components of social lists, the site users might still see cached list results until the cached results expire from the cache. In addition to this, cached results for social lists that are not flagged to contain only public resources are automatically invalidated during user login. You need to take this behavior into account mostly on authoring systems. On a pure rendering system you can typically enable this cache without having to consider this behavior.
The cache instance that is used by the social list cache in the WP Cache Manager Service is named com.ibm.wps.services.lc.cache.SocialListRenderCache
. To enable social list caching, set the following property in WP Cache Manager Service:
For more information about the WP Cache Manager Service see the topic about Cache Manager Service
in the WebSphere
Portal product documentation.
The social list cache caches the full markup that the portal generates when it renders social list personalization components. The following pieces of information are used to build the cache keys for this cache:
- The social list query. The query includes the sources, filters, and sort order
- The social list design reference. The design reference includes the value of the List Appearance component reference
- The page size and page index of the personalization result fragment that is rendered
- The user ID of the current user, if the social list is not flagged to list public objects only
- Custom cache key extensions. By default, the custom cache key extensions are empty. You can add more data to them to achieve a finer tuning for the caches.
The cache is always disabled in project mode. Non-public cache entries are invalidated during login.
How to use the social list cache rendering plug-in
The design components that social rendering provides contain the required calls to the SocialListCache
rendering plug-in to cache social list renderings. If you want to use the social list cache in your own social lists as well, you do not have to use the SocialListCache
rendering plug-in in your social list design components. You can always fully disable the caching for social list rendering by using the corresponding setting in the WP Cache Manager Service resource environment provider.
tag syntax is as follows:
[plugin:IBMConnections:SocialListCache mode="" elementName="" extendedCacheKey=""]
The social list cache parameters are defined as shown in the following list:
Use this mandatory parameter to identify the evaluation mode of the SocialListCache
rendering plug-in. It supports the following modes:
In this mode, the plug-in renders a specific social list personalization component. The specific component to be rendered is identified by an additional elementName parameter. mode="get"
In this mode, the plug-in checks if the rendering result of the social list personalization component that is rendered through the SocialListCache rendering plug-in is available in the cache. If so, the enclosing SocialListCache rendering plug-in returns the cached markup. mode="onCacheMiss"
You can use this mode to bypass further component rendering if the rendering was found in the cache. The markup that is enclosed by a SocialListCache rendering plug-in is only rendered if the result was not found in the cache.
Use this parameter to identify the element of the current content item that contains the component reference to the social list personalization component. This parameter is only evaluated if the parameter mode is set to render. extendedCacheKey
You can use this parameter to feed more information into the cache key. This parameter is only evaluated if the parameter mode is set to get.
The typical way to use the SocialListCache
rendering plug-in consists of three steps:
Starting social list rendering
- Starting social list rendering
- Looking up the value from the cache
- Performing cache aware component rendering.
Looking up the value from the cache
Typically, you start social list rendering in the presentation template that you use to render the social list definition. To render the social list personalization component that is identified by a component reference element named design
, you can use the SocialListCache
rendering plug-in as follows:
[Plugin:IBMConnections:SocialListCache mode="render" elementName="design"]
If you want to create dedicated presentations that do not use social list caching, you trigger the direct rendering of the personalization element by using the standard Element
tag instead. Example:
[Element key="design" type="content" context="current"]
Performing cache aware component rendering
To benefit from the cached data, the rendering plug-in tries to retrieve a possible previous rendering result for the social list from the cache. Typically, you perform the cache lookup in the Header
section of your social list personalization component. To add paging information to the cache key, you have to set the extendedCacheKey
parameter accordingly. See the following example:
extendedCacheKey="[PageInfo value='currentPage']:[PageInfo value='itemsPerPage']"]
Parent topic: Performance tuning for social lists
Cache Manager Service
After the cache lookup, you can skip rendering subsequent components if there is a cache hit. You skip the cache lookup by wrapping those component references in a SocialListCache
tag with the mode parameter set to the value onCacheMiss
. Typically, you skip the cache lookup by the first statement in the Result design
, and No result design
sections of your social list personalization component. For example, your Result design
might look as follows:
[Component name="path/to/your/design/HTML component"]