This applies to reverse proxy configurations only.
The dynamic caching function enables Caching Proxy to cache dynamically generated content in the form of responses from JavaServer Pages (JSP) and servlets generated by a IBM® WebSphere® Application Server. A Caching Proxy adapter module is used at the application server to modify the responses so that they can be cached at the proxy server in addition to being cached in the application server's dynamic cache. With this feature, dynamically generated content can be cached on the edge of the network, freeing the content host from making repeated requests to the application server when more than one client requests the same content.
It is sometimes necessary to enable query caching in order for the dynamic caching feature to work, for example, if your servlets use URLs in the form of queries. The proxy server considers any URL that contains a question mark (?) to be a query.
The caching of dynamically generated content offers the following benefits:
The application server exports only fully composed public pages for proxy caching. Private pages are not cached by the proxy. For example, a dynamically generated page from a public site that lists the current weather forecast can be exported by the IBM WebSphere Application Server and cached by Caching Proxy. However, a dynamically generated page that lists the contents of a user's shopping cart cannot be cached by the proxy server. Also, in order for a dynamically generated page to be cached, all subcomponents of that page also must be cacheable.
Cached dynamic files do not expire in the same way that regular files do; they can be invalidated by the application server that generated them.
Entries in the dynamic cache are invalidated in the following circumstances:
Invalidation of dynamic cache entries is done by generating an Invalidate message for the specific instance of the Caching Proxy dynamic caching plug-in. Caching Proxy receives Invalidate messages as posts to the /WES_External_Adapter resource locator. Caching Proxy then clears the invalid entries from its cache.
Dynamic caching requires the following configuration steps.
Follow the instructions in the IBM WebSphere Application Server documentation for configuring your application server to use its local dynamic cache (also called the dynamic fragment cache). The dynamic fragment cache interacts with the external cache at the Application Server Caching Proxy.
The IBM WebSphere Application Server communicates with Caching Proxy by using a software module called the External Cache Adapter, which is installed with the Application Server.
To enable the proxy server to cache dynamically generated content (results from servlets and JSPs), you must make two changes in the proxy configuration file, ibmproxy.conf. The first change enables the dynamic caching plug-in module, and the second change configures it to recognize the sources of cacheable dynamic content.
An API directive for the Service step is used to enable the dynamic caching plug-in. To create this directive, either manually edit the ibmproxy.conf file, or if the proxy server is already running, use the Configuration and Administration forms to select Server Configuration -> Request Processing -> API Request Processing. The content of the directive is shown in examples that appear later in this section.
A prototype Service directive for enabling dynamic caching exists as a comment in the API section of the ibmproxy.conf file. It has the heading JSP Plug-in. Note that the prototype API directives are in a purposeful order. When adding API directives to enable new features and plug-in modules, order the directives as shown in the prototype section of the configuration file. Optionally, you can remove the comment characters from the prototype API directives and edit them as necessary to include support for each desired function or plug-in.
Set the Service directive as shown in the following examples. (Note that each directive must appear on a single line in the proxy configuration file; these examples sometimes contain line breaks for readability.)
Service /WES_External_Adapter /opt/ibm/edge/cp/lib/plugins/ dynacache/libdyna_plugin.o:exec_dynacmd
Service /WES_External_Adapter /opt/ibm/edge/cp/lib/plugins/ dynacache/libdyna_plugin.so:exec_dynacmd
Service /WES_External_Adapter /usr/lib/libdyna_plugin.so:exec_dynacmd
Service /WES_External_Adapter C:\Program Files\IBM\edge\cachingproxy\cp\bin\plugins\ dynacache\dyna_plugin.dll:exec_dynacmd
If Caching Proxy software is installed in a directory other than the default, substitute your installation path for the path in these examples.
Each Caching Proxy must also be configured to recognize the source of the dynamically generated files. Add an ExternalCacheManager directive to the ibmproxy.conf file for each application server that caches dynamically generated content at this proxy server. This directive specifies a WebSphere Application Server that caches results at the proxy, and sets a maximum expiration time for content from that server. More details appear in ExternalCacheManager -- Configure the Caching Proxy for dynamic caching from IBM WebSphere Application Server.
The server ID used in the ExternalCacheManager directive must match the group ID used in the external cache group stanza of the application server's dynacache.xml file.
For the previous example, add the following entry to each proxy's ibmproxy.conf file.
ExternalCacheManager IBM-edge-cp-XYZ-1 20 seconds
The Caching Proxy caches only contents from a IBM WebSphere Application Server whose group ID matches an ExternalCacheManager entry in the ibmproxy.conf file.