Recipe 10.6 Configuring a Caching Proxy Server

Problem

You want to run a caching proxy server.

Solution

Configure your server to proxy requests, and provide a location for the cached files to be placed:

ProxyRequests on CacheRoot /var/spool/httpd/proxy

Discussion

Running a caching proxy server allows users on your network to have more rapid access to content that others have already requested. They will, perhaps, not be getting the most recent version of the document in question, but, because they are retrieving the content from a local copy rather than from the remote web server, they will get it much more quickly.

With the contents of the WWW growing ever more dynamic, running a caching proxy server perhaps makes less sense than it once did, when most of the Web was composed of static content. However, since mod_proxy is fairly smart about what it caches and what it does not cache, this sort of setup will still speed things up by caching the static portions of documents, such as the image files, while retrieving the freshest version of those documents that change over time.

The directory specified in the CacheRoot directive specifies where cached content will be stored. This directory must be writable by the user that Apache is running as (typically nobody), so that it is able to store these files there.

Finally, note that, while in Apache 1.3, the functions discussed here are provided by mod_proxy; in Apache 2.0, the proxying and caching functionality have been split into the modules mod_proxy and mod_cache, respectively. In either case, these modules are not enabled by default.

See Also

  • http://httpd.apache.org/docs/mod/mod_proxy.html



Apache Cookbook
Apache Cookbook: Solutions and Examples for Apache Administrators
ISBN: 0596529945
EAN: 2147483647
Year: 2006
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net