Caching Web Content Management Components

Custom Caching can be applied to Web Content Management Components by using "Connect" tags to cache individual Components referenced within Presentation Templates. This is done by replacing a Component Reference in a Presentation Template with a "Connect" Tag. This enables you to apply Custom Caching strategies to Web Content Management Components to override your Server's default Caching Strategy. You can also use this method to disable the Caching of Web Content Management Components.

Note that Process Connect Tags must be selected in a Presentation Template form for "Connect" tags to be processed.

 

connect.cfg Changes

It is recommended that a copy of the default Renderer Module tag be added to connect.cfg. This new module setting will be referenced in the "Connect" tags used to cache the Web Content Management component. This is done so that if, at a later stage, the Cacher Module is used as the default module instead of the Renderer Module, then the Renderer Module can still be used to Cache Components.

<!-- Renderer Module -->
<Default class=com.ibm.workplace.Connect.app.render.RendererModule 
         remoteAccess=true 
         autoLoad=false />
<ComponentRenderer class=com.ibm.workplace.Connect.app.render.RendererModule
                   remoteAccess=true 
                   autoLoad=false />

In this example the default Render Module has been copied and renamed as ComponentRenderer

 

Example: Applying Custom Caching

This is an example of the type of Tag that can be used to Cache individual Components within a Presentation Template.

<connect MOD="ComponentRenderer" 
         SRV="cmpnt" 
         PATH="/Site/SiteArea/Content"
         SOURCE="library" 
         CMPNTNAME="TestNav" 
         CACHE="site" 
         EXPIRES="REL 9000s">
</connect>

MOD="ComponentRenderer" References the Web Content Management Render Module.
SRV="cmpnt" The Service for this Module is "cmpnt".
PATH="/Site/SiteArea/Content" Sets the context for the Component.

The "sitepath" and "name" placeholders can be used instead of "PATH=" when caching Menus or Navigators:

<placeholder tag="sitepath"/>/<placeholder tag="name"/>
SOURCE="library" Source is either "content", "site", "sitearea" or "library". In this example it is "library" because the Component we are caching comes from the Component Library.
CMPNTNAME="TestNav" Name of the Component to be cached.
CACHE="site" Either "site or "session".
EXPIRES="REL 9000s" The time the Component will expire from the cache is set here.

The first time the Presentation Template is rendered, the Component will be added to the cache. The next time the Presentation Template is rendered, the Component will be displayed from the cache instead of being rendered afresh by the Web Content Management application. Not until it is expired from the cache will the Component be rendered again by the Web Content Management application. For this reason, only Components that do not require to be freshly rendered every time a page is accessed should be cached.

If you are caching a Component that is used in more than one Presentation Template, it is best practice to save the "Connect" tags as a HTML Component and then reference that Component in each Presentation Template. If you then need to change the Cached Component tags, you only need to change it in the HTML Component rather than in multiple Presentation Templates.

If you have a set of cached Components that use the same "Expires" setting, then it is best practice to save the "Expires=" parameter as a HTML Component and then reference that Component in each Connect tag used to cache Components. If you then need to change the "Expires=" parameter, you only need to change it in the HTML Component rather than in multiple Connect tags. This also applies to any common Cache tags.

 

Example: Disabling Caching

You can also use this method to disable Caching. In this example the property cache=none is used to disable Caching of this component.

<connect
 MOD="ComponentRenderer" SRV="cmpnt" PATH="/Site/SiteArea/Content"
 SOURCE="library" CMPNTNAME="TestNav" CACHE="none" >
</connect>

Parent topic: Component Design Examples.

Parent topic: Displaying Web Content Management Content.

Parent topic: Using Custom Caching.


IBM Workplace Web Content Management - V5.1.0.1 -

 

Workplace Web Content Management is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.