Apache Module mod_cache_disk
implements a disk based storage manager for modcachedisk
The headers and bodies of cached responses are stored separately on disk, in a directory structure derived from the md5 hash of the cached URL.
Multiple content negotiated responses can be stored concurrently, however the caching of partial content is not yet supported by this module.
Atomic cache updates to both header and body files are achieved without the need for locking by storing the device and inode numbers of the body file within the header file. This has the side effect that cache entries manually moved into the cache will be ignored.
tool is provided to list cached URLs, remove cached URLs, or to maintain the size of the disk cache within size and/or inode limits. The tool can be run on demand, or can be daemonized to offer continuous monitoring of directory sizes.htcacheclean
requires the services of modcachedisk
uses the sendfile feature to serve files from the cache when supported by the platform, and when enabled with modcachedisk
. However, per-directory and .htaccess configuration of EnableSendfile
as the corresponding settings are not available to the module when a request is being served from the cache.modcachedisk
will result in a relatively flat hierarchy, with a large number of subdirectories at each level.
will result in a relatively deep hierarchy, with a small number of subdirectories at each level.
directive sets the minimum amount of data, in bytes, to be read from the backend before the data is sent to the client. The default of zero causes all data read of any size to be passed downstream to the client immediately as it arrives. Setting this to a higher value causes the disk cache to buffer at least this amount before sending the result to the client. This can improve performance when caching content from a reverse proxy.
This directive only takes effect when the data is being saved to the cache, as opposed to data being served from the cache.
The default of zero disables this option.
This directive only takes effect when the data is being saved to the cache, as opposed to data being served from the cache. It is recommended that this option be used alongside the
directive to ensure that the server does not buffer excessively should data arrive faster than expected.CacheReadSize
directives define the structure of the directories under the specified root directory.CacheDirLength
Modules | Directives | FAQ | Glossary | Sitemap
Apache HTTP Server Version 2.4
Apache Module mod_cache_disk
Available Languages: en | fr | ja | ko
CacheDirLength Directive
The CacheDirLength directive sets the number of characters for each subdirectory name in the cache hierarchy. It can be used in conjunction with CacheDirLevels to determine the approximate structure of your cache hierarchy.
CacheDirLevels Directive
The CacheDirLevels directive sets the number of subdirectory levels in the cache. Cached data will be saved this many directory levels below the CacheRoot directory.
CacheMaxFileSize Directive
The CacheMaxFileSize directive sets the maximum size, in bytes, for a document to be considered for storage in the cache.
CacheMinFileSize Directive
The CacheMinFileSize directive sets the minimum size, in bytes, for a document to be considered for storage in the cache.
CacheReadSize Directive
The CacheReadSize directive sets the minimum amount of data, in bytes, to be read from the backend before the data is sent to the client. The default of zero causes all data read of any size to be passed downstream to the client immediately as it arrives. Setting this to a higher value causes the di
CacheReadTime Directive
The CacheReadTime directive sets the minimum amount of elapsed time that should pass before making an attempt to send data downstream to the client. During the time period, data will be buffered before sending the result to the client. This can improve performance when caching content from a reverse
CacheRoot Directive
The CacheRoot directive defines the name of the directory on the disk to contain cache files. If the mod_cache_disk module has been loaded or compiled in to the Apache server, this directive must be defined. Failing to provide a value for CacheRoot will result in a configuration file processing erro