Configure remote request dispatcher caching
The creation and handling of the remote request dispatcher (RRD) message and the transfer of this data across a network creates substantial overhead. To improve performance, the local machine can receive the cache rules of the remote server and know when to cache the response locally to prevent the RRD call altogether.
Unsupported rules are cached remotely. However, remote request dispatcher does not support the entire set of rules of the cachespec.xml file for local caching. The following rules for the cachespec.xml file are supported for local caching.
- parameters
- Retrieves the named parameter value.
- cookie
- Retrieves the named cookie value.
- header
- Retrieves the named request header.
- locale
- Retrieves the request locale.
- requestType
- Retrieves the HTTP request method from the request.
Complete the following steps to enable RRD dynamic cache support.
- Enable servlet caching on the local server Refer to the Configuring servlet caching article for more information.
- Construct and install an application with a valid cachespec.xml file policy with RRD supported rules. See the article, Configuring cacheable objects with the cachespec.xml file, for additional information.
- Enable servlet caching on the remote server. Refer to the Configuring servlet caching article for more information.
- Restart WebSphere Application Server. Refer to the Managing application servers article for more information.
Results
To verify that dynamic cache is enabled locally, we can enable RRD trace and verify that there is a CACHE HIT printed out for multiple requests to a resource that has an appropriate cache policy. You also have the option to use CacheMonior instead of turning on tracing. If the CacheMonitor on the remote machine is not receiving cache hits, then the response is cached locally. The local CacheMonitor will not receive hits because RRD uses its own custom cache.
Related tasks
Configure cacheable objects with the cachespec.xml file Configure servlet caching
cachespec.xml file