Using Apache As A Proxy Server - Cache Cow (
Page 6 of 7 )
frequently-accessed Web pages
to connecting clients. Apache comes with a fairly good proxy caching feature,
which can be used to store Web pages on the server and use these locally-cached
copies to serve client requests.
In order to enable this cache, add the
following lines to your Apache 1.3 configuration file:
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache yahoo.com
Most of these are fairly self-explanatory - the CacheRoot
directive sets the directory where cached files will be stored, while the other
directives specify things like maximum cache size and maximum cache flush
interval. It's also possible to exclude certain Web sites from being cached, via
the NoCache directive.
The corresponding directives for Apache 2.0 are:
<IfModule mod_disk_cache.c>
CacheRoot "/usr/local/apache/proxy"
CacheSize 500
CacheDirLevels 5
CacheDirLength 3
</IfModule>
Using a cache can speed up browsing on your network, as the
server can use cached copies to provide faster response times to connecting
clients.