If you used the default settings in the Edge components Product Setup Program to install Caching Proxy, caching is enabled and the cache is stored in memory. You might want to adjust the following basic cache settings to customize the cache for the needs of your system.
If you did not use the setup program, configure these settings to enable caching.
The basic steps necessary to configure caching are the following:
After configuring basic cache settings, you might want to add or change settings for the following features.
Instructions about changing each of these settings are given or referred to in this chapter.
To enable caching, set the Caching directive to on, or check the Enable proxy caching box on the Cache Configuration -> Cache Settings configuration form. If you do not specify a cache device, the cache will be stored in memory. To create a disk cache, follow the steps in 2. Configure cache storage.
The tasks for configuring cache storage depend on whether you use a memory cache or a disk cache.
To use a memory cache, customize the Cache Memory setting so that it includes enough memory to hold the contents of a cache. See Set cache memory for recommended cache memory sizes.
To use a disk cache, you must do the following:
The cache requires a specially formatted device. Devoting an entire device or disk partition to the cache is recommended. The minimum size for a cache is 16392 KB.
To format the cache device:
htcformat raw_device_path [-blocksize block_size]
[-blocks number_of_blocks]
The -blocksize and -blocks arguments
are optional. The default block size is 8192 bytes. If the number of blocks
is not specified, the disk partition will be filled with as many blocks as
it can contain.
When specifying the device path, be sure to specify the raw device path.
raw /dev/raw/raw1 dev/sdb1
See the reference material for your file system for additional information about accessing raw devices.
If the operating system attempts to write to the cache device, cached data can be lost. To avoid this, you can use the Windows Disk Manager utility to prepare the disk before using the htcformat command. To prepare the disk, use the disk utility to delete the device or partition you want to use, then recreate it without formatting it. This causes the system to consider the device unavailable for system storage.
Set the value in the CacheMemory directive (or in the Cache Memory field of the Cache Settings configuration form), according to the following principles. The amount of memory set in this value is used for cache infrastructure support, including the cache index, and, if memory caching is configured, to store the contents of the cache.
For optimum performance of disk caches, a minimum cache memory value of 64 MB is recommended for cache infrastructure support, including the cache index. As the cache size increases, the cache index increases, and more cache memory is required to store the index. A cache memory value of 64 MB is large enough to provide cache infracture support and store a cache index for a disk cache of up to approximately 6.4 GB. For larger disk caches, the cache memory should be 1% of the cache size.
For memory caches, the cache memory value is the amount of memory set aside for the cache infrastructure support and the cache itself. A minimum cache memory value of 64 MB is recommended.
If too much physical memory is allocated for a memory cache, undesirable operations such as "out of memory" errors or proxy server failures can possibly occur. The value limitations for cache memory are due to the limitations of a 32-bit application. Because Caching Proxy is a 32-bit application, it can use a maximum of 2 GB of memory.
Caching Proxy allocates the memory defined by the CacheMemory directive and uses it as the cache to store objects. Additional memory must be allocated, whether it is a memory cache or a raw disk cache, for data structures for the cache, network I/O and connection buffers, session buffers, and memory for the main process and for all the threads. Furthermore, it is possible that requests from some clients might need to allocate a larger memory pool block than the default. Therefore, if the CacheMemory directive is set close to the 2-GB mark, it is possible that Caching Proxy might not have enough memory to operate, especially under high request loads.
It is recommended that the value of the CacheMemory directive be less than or equal to 1600 MB. Setting the value higher than 1600 MB interferes with the memory that Caching Proxy needs for its normal operation, and causes adverse side effects. These side effects typically include but are not limited to increased CPU usage (possibly up to 100% usage), out-of-memory errors, and sluggish performance. If an overall larger cache size is required, use cache devices or implement a shared cache configuration with RCA or ICP.
You can import and export cache contents to or from a dump file. This is useful when cache memory gets lost during restart, or when deploying the same cache for multiple proxies.
Filters can restrict what is cached by matching the form of the URL request. See Controlling what is cached for details about setting filters.
Optionally, you can configure the proxy server to cache results of query requests. By default, URLs that contain a question mark (?) are not cached. Refer to Caching query responses for details.
Another option is to cache results of servlet or JSP execution from an IBM® WebSphere® Application Server. Refer to Caching dynamically generated content for details.
Refer to Maintaining cache content for information about configuring when files in the cache expire and how obsolete files are removed.
The cache can be configured to automatically refresh the most popular files on a daily basis, before they are requested. Refer to Configuring the cache agent for automatic refreshing and preloading for information.
Under certain circumstances, using a shared cache increases the likelihood that a requested file is found in the cache. Refer to Using a shared cache for information.
Maintaining concise and accurate logs is important for managing Caching Proxy. Monitoring Caching Proxy contains information about configuring and using proxy server logs.