Portlet Factory, Version 6.1.2
Cache Control builder
The Cache Control builder allows you to cache the output of a specific action within a model. All users in a given profile who access that model are presented with action output information drawn from a cache. Under certain circumstances, such caching can improve performance.
Action output caching is appropriate for content that is dynamically generated but changes infrequently. For example, this type of content might result from a method that makes a database call that returns results that are the same for all users.
If the data in the database is relatively static, changing only once per hour, the overhead of querying the database and generating the page every time a user accesses the model is probably not justifiable. This database scenario presents a good opportunity to cache results (in this case, a database service) and refresh those results on an hourly basis. This is what the Cache Control builder allows you to do.
Note: Cached action output is shared among users having a common profile for as long as the action output is in the cache.
Do not cache the output of a method or action list that contains a processPage(..). Process page output goes directly back to the client and is not the output of the method or action list.
About using the Cache Control builder
Use the Cache Control builder to select and configure action output caching. In this builder, set the caching properties of a specified action within the WebApp. You can:
- Activate caching for a specific model action by selecting the action.
- Length of the time action output is retained in the cache. Data is cleared from the action output cache once the time limit expires.
Parent topic: Builder help
- About using the builder call editor
The builder call editor allows you to specify all the input values to a builder call.
- Cache Control builder inputs
This topic describes the inputs for the Cache Control builder.
- Specifying a key in the Cache Control builder
In the Cache Control builder's Keys input you can specify a method-type action or variable in your model as a cache key.
- Background on caching
Caching occurs at two levels within IBM® WebSphere Portlet Factory.
- Accessing cache statistics
You can view general cached output statistics in the server statistics log files.
- Getting cache statistics
An API exists that you can use to get cache statistics. The class com.bowstreet.util.cache.CacheManager is available to return cache data.
- High-level regenerated model cache
The highest level of caching in IBM WebSphere Portlet Factory is regenerated model caching.
- Low-level action output cache
The lower level of caching is action output caching.
- Caching methods with input arguments
For methods that have input arguments, there is a separate cache entry for every unique set of input values.
- Setting cache time out values
The number of seconds you specify as the cache time out value depends on the application you are creating.
- Deciding which actions to cache
This topic describes some guidelines that help when deciding whether or not to cache a model action.
Library | Support |