Servlet caching configuration assembly settings
Configure your cache groups. Access this page by traversing the following path in the Application AssemblyTool: Web Modules > component_instance > Assembly Property Extensions
The properties on the General tab define a cache group and govern how long an entry remains in the cache. The properties on the ID Generation tab define how cache IDs are built and the criteria used to cache or invalidate entries. The properties on the Advanced tab define external cache groups and specify custom interfaces for handling servlet caching.
Caching group name
- Specifies a name for the group of servlets or JSP files to cache.
Priority
- Defines the default priority for cached servlets. Specify as an integer. The default value is 1.
Priority is an extension of the Least Recently Used (LRU) caching algorithm. It represents the number of cycles through the LRU algorithm that an entry is guaranteed to stay in the cache. The priority represents the length of time that an entry remains in the cache before becoming eligible for removal. On each cycle of the algorithm, the priority of an entry is decremented. When the priority reaches zero, the entry is eligible for invalidation. If an entry is requested while in the cache, its priority is reset to the priority value. Regardless of the priority value and the number of requests, an entry is invalidated when its timeout occurs. Consider increasing the priority of a servlet or JSP file when it is difficult to calculate the output of the servlet or JSP file or when the servlet or JSP file is executed more often than average. Priority values should be low. Higher values do not yield much improvement but use extra LRU cycles. Use timeout to guarantee the validity of an entry. Use priority to rank the relative importance of one entry to other entries. Giving all entries equal priority results in a standard LRU cache that increases performance significantly.
Timeout
- Specifies the length of time, in seconds, that a created cache entry remains in the cache.
When this time elapses, the entry is removed from the cache. If the timeout is zero or a negative number, the entry does not time out. It is removed when the cache is full or programmatically, from within an application.
Invalidate only
- Specifies that invalidations for a servlet take place, but that no servlet caching is performed.
For example, you can use this property to prevent caching of control servlets. Control servlets treat HTTP requests as commands and execute those commands. By default, this check box is not selected.
Caching group members
- Specifies the names of the servlets or JSP files to cache. The URIs are determined from the servlet mappings.
Use URIs for cache ID building
- Specifies whether or not to use the URI of the requested servlet to create a cache ID. By default, URIs are used.
Use specified string
- Specifies a string representing a combination of request and session variables to use for creating cache IDs. This property defines request and session variables, and the cache uses the values of these variables to create IDs for the entries.
Variables - ID
- Specifies the name of a request parameter, request attribute, session parameter, or cookie.
Variables - Type
- Specifies the type of variable inidcated in the ID field. The valid values are Request parameter, Request attribute, Session parameter, or Cookie.
Variables - Method
- Specifies the name of a method in the request attribute or session parameter. The output of this method is used to generate cache entry IDs. If this value is not specified, the toString method is used by default.
Variables - Data ID
- Specifies a string that, combined with the value of the variable, generates a group name for the cache entry. The cache entry is placed in this group. One can invalidate this group.
Variables - Invalidate ID
- Specifies a string that is combined with the value of the variable on the request or session to form a group name. The cache invalidates the group name.
Required
- Specifies whether a value must exist in the request. If this check box is selected, and either the request parameter, request attribute, session parameter, or the method is not specified, the request is not cached.
External cache groups - Group name
- Specifies the name of the external cache group to which this servlet is published.
ID generator
- Specifies a user-written interface for handling parameters, attributes, and sessions.
The value must represent a full package and class name of a class extending com.ibm.websphere.servlet.cache.IdGenerator. The properties specified in the Application Assembly Tool are used and passed to the IdGenerator in the initialize method inside a com.ibm.websphere.servlet.cache.CacheConfig object.
Data type String
Meta data generator
- Specifies a user-written interface for handling invalidation, priority levels, and external cache groups.
The value must represent the full package and class name of a class extending com.ibm.websphere.servlet.cache.MetaDataGenerator. The properties specified in the Application Assembly Tool are used and passed to the MetaDataGenerator in the initialize method inside a com.ibm.websphere.servlet.cache.CacheConfig object.
Data type String
Assembling Web Modules