Most caching proxy servers cache a file only after a user requests it. Caching Proxy has a cache agent that provides automatic cache preloading. You can specify that the cache agent automatically retrieves specified URLs, the most popular URLs, or both, and places them in the cache before they are requested.
In some cases, you need to set the host name of the proxy server and identify the cache access log before the cache is preloaded. To configure the cache agent, in the Configuration and Administration forms, select Cache Configuration and use the Cache Preload and Cache Refresh forms. Note that files representing query results (that is, files whose URLs include the question mark character (?) are cached only if query caching is enabled).
Automatic cache refreshing and preloading provides the following advantages:
Disadvantages include the following:
For optimal efficiency, set the cache agent to run when server activity is low and before the server becomes busy with client requests. Then the files are ready in the cache to provide fast service the first time a user requests them. By default, the cache agent is started every night at 3 a.m. local time.
Special considerations for reverse proxy configurations:
For security reasons, when you use a reverse proxy configuration, the Proxy http:* rule should be disabled, by default. (That is, this rule is commented in the ibmproxy.conf file.) However, if the rule is disabled, the cache agent is prevented from successfully sending requests and refreshing the cache content of Caching Proxy. A "403 Forbidden By Rule Error" in the error log results and refreshing the cache does not complete.
To avoid this problem, use cacheAgentService, which is an internal service provided by Caching Proxy. To enable the service, put the following Service directive before any other mapping rules in the ibmproxy.conf file:
Service /any-valid-string* INTERNAL:cacheAgentService
The variable any-valid-string is any string that is valid and that does not conflict with other mapping rules in the ibmproxy.conf file.
Both Caching Proxy and cache agent parse the URI based on this service directive. Instead of sending the URI directly to Caching Proxy, the cache agent utility prepends the URI with the /any-valid-string pattern in the service directive.
For example, the cache agent transforms the following URI:
http://www.ibm.com/
to
/any-valid-string/http://www.ibm.com/
The cache agent sends the URI with the prefix to Caching Proxy. When Caching Proxy receives the request, it removes the prefix /any-valid-string/. If the remaining URI is a fully qualified unit, Caching Proxy directly serves the request without mapping the URI against other rules.
Additionally, the cache agent can send a relative URI to Caching Proxy. For example, if you add LoadURL /abc/ using the previously referenced service directive in the ibmproxy.conf file, the cache agent transforms it into /any-valid-string/abc/ and sends it to Caching Proxy. Caching Proxy receives the URL, removes the prefix, maps /abc/ against other mapping rules, and handles the request if there is a match.
For information on the Service directive, see Service -- Customize the Service step.