WAS v8.5 > End-to-end paths > Dynamic caching > Improving service with the dynamic cache service > Tasks: Using the dynamic cache service to improve performance > Use the DistributedMap and DistributedObjectCache interfaces for the dynamic cache

Use object cache instances

Perform this task so the application can access dynamic cache object cache instances with the DistributedMap or DistributedObjectCache interfaces.

Before beginning, enable the dynamic cache service. See Use the dynamic cache service for more information.

Use object cache instances can improve the performance of the application because we can programmatically store and share frequently used objects. By using object cache instances, you also have the necessary control over the dynamic cache when we are running multiple applications in an application server. See Cache instances for more information.

  1. Configure one or more cache instances.

    1. In the dmgr console, click Resources > Cache instances > Object cache instances.

    2. Specify the scope for the cache instance.

      Cell scope makes the cache instance available to all servers within the cell. Node scope makes the cache instance available to all servers on the particular node. Cluster scope makes the cache instance available to all members in a specified cluster. Server scope makes the cache instance available to only the selected server. We can mix scopes, if necessary.

    3. Click Apply after changing the scope.

    4. Click New.

    5. Enter the JNDI name for this cache instance.

      This is name that you pass to the InitialContext lookup() method from within the application. For example, services/cache/instance_one.

    6. Enter or modify other properties as needed.

  2. Update the application. To store and retrieve objects in an object cache instance, you need a DistributedMap or DistributedObjectCache reference for the named object cache instance. See Use the DistributedMap and DistributedObjectCache interfaces for the dynamic cache for more information.


Results

You configured object cache instances that we can access programmatically with the DistributedMap and DistributedObjectCache interfaces.

See Additional Application Programming Interfaces (APIs) for more information about the DistributedMap or DistributedObjectCache interfaces.


Related concepts:

Cache instances


Related


Use the DistributedMap and DistributedObjectCache interfaces for the dynamic cache


+

Search Tips   |   Advanced Search