Portlet Factory, Version 6.1.2


 

Cache Control builder inputs

This topic describes the inputs for the Cache Control builder.

Table 1. Cache Control builder inputs
Input Name Description
Name Name for this builder call. The WebSphere Portlet Factory Designer displays this name in the builder call list.
Action to Cache Select an action to cache in the list.
Refresh Interval (seconds) Enter the time in seconds that the selected action output should be retained in the cache. For example, enter 3600 to retain the action output in the cache for 60 minutes.
Keys Use the reference picker to choose a key that selects a value in the cache, where each unique value of the key represents a saved value of the action. When some other operation attempts to call the action, first the key expression is evaluated and the result compared to stored keys in the cache. If there is a match, the action is not called and the saved result associated with that value of the key is immediately returned.

If the key is not found in the cache, the action is called normally and its result is saved in the cache, associated with that key value.

The value is expected to be a String, so your method or action should return a String object. An XML Variable reference (for example, ${Variables/MyXml} for string inputs) results in a reference to the child text node of the top level element (or the element specified in the indirect reference), and not the entire XML structure. To use the string representation of an entire XML variable structure as the cache key value, supply one of the following specifications.

  • An indirect reference to a Method that returns a toString() of the XML variable value

  • An indirect Java reference such as the following.
    ${Java/webAppAccess.getVariables().getXml("MyXMLVar").toString()}

Note: If you cache a method with arguments, and no key action items are specified, method argument values are automatically used as cache keys. When these values change, the action cache is refreshed.

Parent topic: Cache Control builder


Library | Support |