Use servlet cache instances
Use this task to configure servlet cache instances.
Before beginning, enable the dynamic cache service.
Perform this task so that the application can access dynamic cache servlet cache instances. Using servlet cache instances can improve the performance of the application because we can store the output and the side effects of an invoked servlet. Servlet cache instances also give you control over the cache for multiple applications that are running in an application server. Refer to the Cache instances topic for more information.
- Enable servlet caching. Refer to the Configuring servlet caching topic for more information.
- Configure one or more cache instances.
- In the console, click Resources > Cache instances > Servlet cache instances.
- Specify the scope of the cache instance. Specify a scope of cell to make the cache instance available to all the servers that are in the cell. Node scope makes the cache instance available to all servers in a node. Server scope makes the cache instance available to the selected server only. If necessary, we can mix the scopes.
We cannot create cache instances (object or servlet) at different scopes with the same cache name or JNDI name.
- Click Apply to save the scope.
- Specify the settings for the cache instance. The Name and Java Naming and Directory interface (JNDI) name fields are required. The JNDI name is the name attribute specified in the <cache-instance> element in the cachepec.xml file. An example of a JNDI name specified in the cachespec.xml file follows:
<cache-instance name="services/cache/instance_one">
In this example, specify services/cache/instance_one as the JNDI name.
- Update the application. To use a servlet cache instance, specify a <cache-instance> element that has a name that is equal to the JNDI Name for this cache instance.
Subtopics
- Invalidating entries in a servlet cache
Use this task to invalidate a cache entry from a servlet cache instance.
- Servlet cache instance collection
A servlet cache instance is a location, in addition to the default shared dynamic cache, where dynamic cache can store, distribute, and share data. By using servlet cache instances, the applications have greater flexibility and better tuning of the cache resources. The JNDI name specified for the cache instance is mapped to the name attribute in the <cache-instance> tag in the cachespec.xml configuration file.
- Servlet cache instance settings
A servlet cache instance is a location, in addition to the default shared dynamic cache, where dynamic cache can store, distribute, and share data. By using servlet cache instances, the applications have greater flexibility and better tuning of the cache resources. The Java Naming and Directory Interface (JNDI) name specified for the cache instance is mapped to the name attribute in the <cache-instance> tag in the cachespec.xml configuration file.
- Use the DynamicContentProvider interface for dynamic cache
Use this task to configure the DynamicContentProvider interface for cached servlets and JSPs files.
Related concepts
Cache instances
Related tasks
Invalidating entries in a servlet cache Use object cache instances Use the dynamic cache service Configure servlet caching