Cache IWWCM elements

 

+

Search Tips   |   Advanced Search

 

We can apply caching to elements by using "connect" tags to reference elements within presentation templates instead of the component or element tag.

Process Connect Tags must be selected in a presentation template form for connect tags to be processed.

 

Example: Applying custom caching

This is an example of the type of tag that can be used to cache individual elements 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" This references the Web Content Management Render Module.
SRV="cmpnt" The Service for this Module is "cmpnt".
PATH="/Site/SiteArea/Content" This sets the context for the element.

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 element you are caching comes from a component.
CMPNTNAME="TestNav" This is the name of the element to be cached.
CACHE="site" This is 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 element will be added to the cache. The next time the presentation template is rendered, the element 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 element be rendered again by the Web Content Management application. For this reason, only elements 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 tag 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

We can also use this method to disable caching. In this example the property cache=none is used to disable caching of this element.

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

 

Parent Topic

Use custom caching