Set 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.
Complete the following steps to enable RRD dynamic cache support.
- 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.
- Enable servlet caching on the local server See Set servlet caching for more information
- Construct and install an application with a valid cachespec.xml file policy with RRD supported rules. See the article, Set cacheable objects with the cachespec.xml file, for additional information.
- Enable servlet caching on the remote server. See Set servlet caching for more information
- Restart WAS. See Manage appservers 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. We 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
Set cacheable objects with the cachespec.xml file
Set servlet caching
Related
cachespec.xml file