Using a shared cache

It is common for a point of presence on the Web to have more traffic than a single server can handle. One solution is to simply add more servers. However, when multiple caching proxy servers are used, the contents of one cache often overlap with the contents of the other caches. In addition to unnecessary redundancy in storage, maximum bandwidth savings are not achieved because a cached file is re-fetched from the origin server when a request for it comes to a proxy server that does not have that file in its own cache. Although duplicate caching can be minimized by using a hierarchical chain of proxy servers, this scenario still results in additional traffic through a given server, and each additional link in the chain adds latency.

Cache sharing solves these problems by allowing each cache to share its contents with the other caches. Bandwidth savings result because of the following facts:

Two methods are provided for using multiple caches as if they are one logical cache:

RCA and ICP can be used together.

Remote cache access

In planning for RCA, consider the following recommendations:

Remote cache access is not appropriate if any of these conditions is violated or if different organizations manage different servers that are members of the array.

Configuring remote cache access

To configure remote cache access, in the Configuration and Administration forms, select Cache Configuration -> Remote Cache Access. The fields in this form define a named array that shares one logical cache. Enter the required information for each member of the array.

To configure remote cache access by editing the proxy configuration file, see the reference sections in Appendix B. Configuration file directives for the following directives:

Configuring the Internet Caching Protocol plug-in

The Internet Caching Protocol plug-in enables a Caching Proxy to query ICP-compliant caches in search of HTML pages and other cacheable resources. When the proxy server receives an HTTP request, it searches its own cache for the resource. If the resource is not found in the local cache and the ICP plug-in is enabled, the proxy server encapsulates the URL request in an ICP query packet and then delivers this packet to all identified ICP peer caches. If a peer cache responds that it has the resource, the proxy server retrieves the resource from that peer's cache. If two or more peers respond positively, the first response is processed. If no peers respond with hits, the original server continues to process the request according to its workflow. For example, the proxy server can invoke another plug-in, continue to the Remote Caching Access routine (if RCA is enabled), or retrieve the requested resource itself.

Configuring the ICP plug-in

The ICP plug-in is activated and configured by editing the proxy configuration file, ibmproxy.conf. A ServerInit directive, a PreExit directive, or both must be added to the API directives section of the configuration file in order to use the ICP plug-in. Which directives are used depends on the role that Caching Proxy has in the ICP system:

To create these directives, either manually edit the ibmproxy.conf file, or if the proxy server is already running, connect to the Configuration and Administration form Server Configuration-> Request Processing -> API Request Processing.

Note that prototype directives (in the form of comments) have been added to the API section of the ibmproxy.conf file. These 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. Alternatively, uncomment and edit, if necessary, API directives to include support for each desired function or plug-in.

Both the ServerInit and the PreExit directives have two arguments: (1) the fully qualified path of the shared library and (2) the function call. These arguments are delimited by a colon (:). The first argument is system specific and depends on where the plug-in components are installed. The second argument is hard-coded into the shared library and must be typed exactly as shown.

Each directive must appear on a single line in the proxy configuration file.

ServerInit path_of_shared_library:icpServer

Linux and UNIX example:

ServerInit /opt/ibm/edge/cp/internet/lib/plugins/icp/libicp_plugin.so:icpServer

Windows example:

ServerInit C:\Program Files\IBM\edge\cachingproxy\cp\Bin\plugins\icp\icpplugin.dll:icpServer
PreExit path_of_shared_library:icpClient

Linux and UNIX example:

PreExit /opt/ibm/edge/cp/internet/lib/plugins/icp/libicp_plugin.so:icpClient

Windows example:

PreExit C:\Program Files\IBM\edge\cachingproxy\cp\Bin\plugins\icp\icpplugin.dll:icpClient

To configure settings of the plug-in, add or modify the ICP* directives that are provided in the proxy configuration file. For additional information, refer to the descriptions of the following directives.