next up previous contents
Next: Imagemap Configuration Up: CERN HTTPD Previous: Protecting Access to

Configuring CERN HTTPD as a Caching Proxy

CERN HTTPD 3.0 can be configured to perform as a caching proxy server (see section 5.4). This is important, because it can greatly improve external performance for your local users and also greatly reduce international traffic.

Caching can be enabled by commands in the main server configuration file. The following is a typical configuration setup:

http_proxy http://www.hensa.ac.uk/
gopher_proxy http://www.hensa.ac.uk/
ftp_proxy http://www.hensa.ac.uk/
no_proxy uk
Pass http:*
Pass gopher:*
Pass ftp:*

Caching ON
NoCaching http://www.cs.ucl.ac.uk/*
CacheRoot /cs/research/mice/boom/scratch1/wwwcache
CacheSize 300 M
CacheLastModifiedFactor 0.2
GcDailyGc 2:00

The first few lines here configure the server as a proxy server. In this case we have configured the server to be a proxy server for http, gopher and ftp using the `` Pass'' commands. We've also configured it to use an outer proxy server at www.hensa.ac.uk for sites that are not in the UK.

The next few lines configure the way the cache behaves. `` CacheSize'' configures the maximum amount of space the server is to use for its cache - in the case 300 MBytes. `` CacheRoot'' specifies the directory to store the cache temporary files in. Note that if your system manager backs up your filestore periodically, these cache files should not be backed up, or they will add unnnecessary load on your backup system.

The last two lines take a little more explanation:

CacheLastModifiedFactor 0.2

This specifies how long files are kept for if no expiry date is given by the remote server. If the remote server returns a last modified date that says the file last changed 5 months ago, then a `` CacheLastModifiedFactor'' of 0.2 says to keep that file for a further 1 month (ie months).
GcDailyGc 2:00

When the cache size limit is reached, the server will perform garbage collection - that is it will remove expired files and will then remove other old files that take up too much space until the cache occupies less than the size limit. However, this may mean that old files are kept around long after they're needed, and if you want to use their disc space for anything else, enabling daily garbage collection may be a good idea. The `` GcDailyGc'' command specifies the time of day (in 24hr clock) to run the garbage collection.

A number of other cache control commands are also available for use in the server configuration file, and are described in more detail in the CERN HTTPD Reference Manual.



next up previous contents
Next: Imagemap Configuration Up: CERN HTTPD Previous: Protecting Access to



Jon Crowcroft
Wed May 10 11:46:29 BST 1995