Web Content Manager performance can be improved by enabling caching. In fact we recommend to enable caching for WCM for production sites. There are multiple caching options with WCM.
Fragment caching allows to cache data for a single user or across all users for a WCM rendering portlet.
WCM Advanced caching caches WCM data at the WCM core level - below the WCM portlets. It is flexible - 5 different cache configurations are possible. The most common used option typically is Secured caching in which the cache key is computed based on the group membership of the user.
The downside of WCM Advanced caching is that you can not control that for certain WCM rendering portlets no cache is being used since the caching happens below the portlets. The reason why you might want to disable Advanced caching for certain WCM rendering portlets could be that some data in them has to be immediately visible or that the portlet displays WCM content that uses PZN rules (PZN rule results would be cached and the rule not executed any more).
Using fragment caching in the WCM portlets can be an alternative to
Advanced caching but it does not allow to use Secured caching or the
other caching options of WCM Advanced caching - it only allows to have a
shared cache across all users or a personal cache for each user.
I have implemented a preprocessor that can be configured per WCM rendering portlet to disable the WCM data in this portlet from being cached in the Advanced cache. The attachment below points to a zip file containing a war file. To use the preprocessor deploy the war file with an arbitrary context root via the WebSphere Application Server Admin Console and start the Application. The source code is attached in the war and can be modified. Then edit the WCM rendering portlet configuration and select the now visible preprocessor "NoCachePreProcessor" - save the portlet.
See the usual DISCLAIMER OF WARRANTIES:
The enclosed code is sample code created by IBM Corporation.
This sample code is provided to you solely for the purpose of assisting you in the development of your applications. The code is provided "AS IS", without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample code, even if they have been advised of the possibility of such damages.
Stay tuned for another blog entry about how to customize the cache key of the Advanced WCM Cache.