Controlling what is cached

Caching Proxy offers several filtering methods to control which files, documents, and other objects are cached

The following features enable you to control what is cached:
  • URL-based caching filters
  • Query response caching
  • Caching locally served files
  • Partial URL-based caching
  • Caching files that are based on part of the request URL
  • Caching dynamically generated files
Note: The Cache Configuration –> Cache Behavior Configuration and Administration form contains an option that is labeled Cache based on incoming URL. (The corresponding configuration file directive is named CacheByIncomingURL.) This directive refers to the file name of the cached file. Check this box to base the file name of the cached file on the incoming URL; if this box is not checked, the file name is based on the outgoing URL.

Configuring URL-based caching filters

The proxy server can be configured to compare requests to a URL template to determine whether a file is cached. This feature is configured by setting templates for requests whose files are always cached, and separate templates for requests whose files must never be cached. Multiple templates can be used.

A similar system is used to enable query response caching.

To set URL caching filters in the Configuration and Administration forms, use the Cache Configuration –> Cache Behavior: Cache filtering by URL field. Use this section to specify URLs whose files are always cached, or to specify URLs whose files are never cached. To specify two lists, one of files to always cache and one of files to never cache, create one list and then click Submit before creating the other list.

Caching query responses

The responses that are returned from queries (URL requests that contain a question mark) can be cached by using caching filters. This feature can be useful in reverse proxy (surrogate) scenarios if many clients make the same query request.

Query caching can be configured by editing the CacheQueries directive in the ibmproxy.conf configuration file. The CacheQueries directive has the following options:
  • Always — all query responses from hosts matching the template are cached, if they are cacheable by HTTP 1.1 standards.
  • Public — query responses from hosts matching the template are cached if they contain the Cache-control: public header or a forced revalidation header, and they are cacheable by HTTP 1.1 standards.

To configure query response caching in the Configuration and Administration forms, use the Cache Configuration –> Cache Behavior: Cache Query Response filtering by URL field. To specify two lists, create one list and then click Submit before creating the other list.

More requirements for query response caching

In addition to configuring the query caching setting, ensure that the following settings are configured properly to enable query responses to be cached.

Caching locally served files

Because it is typically inefficient to cache files that are served from the proxy server, files originating in the server's local domain are not cached by default. To cache objects that originate in the server's local domain, check the Cache local domain files box on the Cache Configuration –> Cache Behavior Configuration and Administration form. Alternatively, set the CacheLocalDomain directive in the proxy configuration file to on.

Caching files by partial URL

Items can be cached based only on a specified (significant) part of the incoming URL, instead of the full URL. This is useful in transaction-model web serving or for dynamic caching because the same response is often returned for varying incoming requests when significant parts of the incoming requests' URLs are identical.

You cannot use the Configuration and Administration forms to specify caching that is based on partial URLs. Instead, use the SignificantUrlTerminator directive in the proxy configuration file to specify a terminating code for URL requests. This specification causes Caching Proxy to evaluate only characters before the terminating code when it processes the request and determines whether the requested file is cached. When more than one terminator code is defined, Caching Proxy compares incoming URLs against the terminator codes in the order in which they are defined in the ibmproxy.conf file.

Related configuration file directives


Icon that indicates the type of topic Reference topic



Timestamp icon Last updated: March 23, 2018 0:18
File name: whichcache.html