# Copyright (c) 1998 University of Southern California. # All rights reserved. # # Redistribution and use in source and binary forms are permitted # provided that the above copyright notice and this paragraph are # duplicated in all such forms and that any documentation, advertising # materials, and other materials related to such distribution and use # acknowledge that the software was developed by the University of # Southern California, Information Sciences Institute. The name of the # University may not be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. LSAM CONFIGURABLE CACHE REPLACEMENT POLICIES ============================================ Document Version 1.0 (3/25/98) More Information: http://www.isi.edu/lsam/dynamic-cache Introduction ------------ The LSAM Proxy suports several different cache replacement algorithms. The choice of algorithm can be specified in the httpd.conf configuration file and is static. This allows the proxy administrator to select an algorithm appropriate to the use of the server. The default Apache algorithm replaces files based on their expire times, the files closest to expiring will be removed first. The new algorithms that have been added include: FIFO, LRU, file size replacement (replace large or small files first), and download- time replacement (replace the files with the longest or shortest download time first). At present, Apache uses the same algorithm throughout the life of the server. In the future, we will implement mechanisms to allow a new caching algorithm to be selected by the server administrator or the server itself at run-time based on usage observations. Compilation ----------- 1. Modify apache/src/Configuration to include this line: EXTRA_CFLAGS+=-D_LSAM_CACHE 2. Run the Apache configuration utility 3. Compile Configuration ------------- To specify the caching algorithm, activate the following directive in the httpd.conf file for your proxy server: # CacheGCAlgorithm 0 You must also specify which caching algorithm should be used. The value specified selects an individual algorithm as follows: 0 = EXPIRE, replaces files based on the oldest expire times 1 = LARGE, replaces largest files first 2 = SMALL, replaces smallest files first 3 = LONG_DL, replaces files with longest download times first 4 = SHORT_DL, replaces files with shortest download times first 5 = FIFO, straight FIFO file replacement 6 = LRU, straight LRU file replacement Integer values larger than 6 default to EXPIRE, which is the original Apache replacement algorithm. Execution --------- Run the server normally. Upcoming Features ----------------- The following features can be expected in the next release of the LSAM Proxy: * Cache replacement algorithm can be changed without restarting the proxy * Mechanisms will be in place to collect data about the usage of the cache and server as support for a future