Sun Java System Web Proxy Server 4.0.3 2006Q2 Administration Guide

Configuring the Cache

You can configure the kind of caching you want for specific resources, using the Set Caching Configuration page. You can specify several configuration parameter values for URLs matching the regular expression pattern that you specify. This feature gives you fine control of the proxy cache, based on the type of document cached. Configuring the cache can include identifying the following items:


Note –

If you set the cache default for a particular resource to either Derived configuration or Don’t cache, the cache configuration options will not appear on the Set Caching Configuration page. However, if you choose a cache default of Cache for a resource, you can specify several other configuration items.


ProcedureTo configure the cache

Steps
  1. Access the Server Manager, and click the Caching tab.

  2. Click the Set Caching Configuration page.

    The Set Caching Configuration page displays.

  3. Select the resource from the drop-down list or click the Regular Expression button, enter a regular expression, and click OK.

  4. Change the configuration information.

  5. Click OK.

  6. Click Restart Required.

    The Apply Changes page displays.

  7. Click the Restart Proxy Server button to apply the changes.

Caching Configuration Elements

The following sections describe the items listed on the Set Caching Configuration page. These sections include information that will help you to determine which configuration will best suit your needs.

Setting the Cache Default

The proxy server allows you to identify a cache default for specific resources. A resource is a type of file that matches certain criteria that you specify. For instance, you may want your server to automatically cache all documents from the domain company.com. If so, click the Regular Expression button on the top of the Set Caching Configuration page and, in the field that appears, enter

[a-z] *://[^/:]\\.company\\.com.*.

By default, the Cache option is selected. Your server automatically caches all cacheable documents from that domain. For more information on regular expressions, see Understanding Regular Expressions.


Note –

If you set the cache default for a particular resource to either Derived configuration or Don’t cache, it is not necessary to configure the cache for that resource. However, if you choose a cache default of Cache for a resource, you can specify several other configuration items. For a list of these items, see Configuring the Cache.


The cache default for HTTP, FTP, and Gopher can also be set on the Set Cache Specifics page.

Caching Pages That Require Authentication

You can have your server cache files that require user authentication. If you choose to have your Proxy Server cache these files, it tags the files in the cache so that if a user asks for them, it knows that the files require authentication from the remote server.

Because the proxy server does not know how remote servers authenticate and it does not know users’ IDs or passwords, it will simply force an up-to-date check with the remote server each time a request is made for a document that requires authentication. The user therefore must enter an ID and password to gain access to the file. If the user has already accessed that server earlier in the Navigator session, Navigator automatically sends the authentication information without prompting the user for it.

If you do not enable the caching of pages that require authentication, the proxy assumes the default, which is to not cache them.

Caching Queries

Cached queries only work with HTTP documents. You can limit the length of queries that are cached, or you can completely inhibit caching of queries. The longer the query, the less likely it is to be repeated, and the less useful it is to cache.

These caching restrictions apply for queries: the access method has to be GET, the document must not be protected (unless caching of authenticated pages is enabled), and the response must have at least a Last-modified header. This requires the query engine to indicate that the query result document can be cached. If the Last-modified header is present, the query engine should support a conditional GET method (with an If-modified-since header) in order to make caching effective; otherwise it should return an Expires header.

Setting Minimum and Maximum Cache File Sizes

You can set the minimum and maximum sizes for files cached by your Proxy Server. You may want to set a minimum size if you have a fast network connection. If your connection is fast, small files may be retrieved so quickly that it is not necessary for the server to cache them. In this instance, you would want to cache only larger files. You may want to set a maximum file size to make sure that large files do not occupy too much of your proxy’s disk space.

Setting the Up-to-date Checking Policy

You can use this option to ensure that the HTTP document is always up-to- date. You can also specify the refresh interval for the Proxy Server.

Setting Expiration Policy

You can set the Expiration Policy using the last modified factor or the explicit expiration information.

Setting Cache Behavior for Client Interruptions

If a document is only partly retrieved and the client interrupts the data transfer, the proxy has the ability to finish retrieving the document for the purpose of caching it. The proxy’s default is to finish retrieving a document for caching if at least 25 percent of it has already been retrieved. Otherwise, the proxy terminates the remote server connection and removes the partial file. You can raise or lower the client interruption percentage.

Behaviour On Failure To Connect To Server

If an up-to-date check on a stale document fails because the origin server is unreachable, you can specify whether the proxy sends the stale document from the cache.