mod_disk_cache

mod_disk_cache overview

mod_disk_cache implements a disk-based storage engine for mod_cache.

To enable disk-based storage engine for mod_cache use this minimum configuration:

# in server or virtual host config
CacheRoot c:\inetpub\cache

CacheEnable disk /app1
# or via env
SetEnv cache-enable disk

See CacheEnable directive

Cache cleanup

Warning!
Disk-based cache entries are not deleted after expiration, they are only overwritten by fresh copies. We recommend to clean the cache manually. For example, just delete all directories and files in cache root every day (via scheduler).

See also

mod_disk_cache directives

CacheDirLength

Description: The number of characters in subdirectory names
Syntax: CacheDirLength length
Default: CacheDirLength 2
Context: server config, virtual host
Module: mod_disk_cache

The CacheDirLength directive sets the number of characters for each subdirectory name in the cache hierarchy.

Example:

CacheDirLength 3

CacheDirLevels

Description: The number of levels of subdirectories in the cache.
Syntax: CacheDirLevels levels
Default: CacheDirLevels 3
Context: server config, virtual host
Module: mod_disk_cache

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.

Example:

CacheDirLevels 5

CacheMaxFileSize

Description: The maximum size (in bytes) of a document to be placed in the cache
Syntax: CacheMaxFileSize bytes
Default: CacheMaxFileSize 1048576 (1 Mb)
Context: server config, virtual host
Module: mod_disk_cache

The CacheMaxFileSize directive sets the maximum size, in bytes, for a document to be considered for storage in the cache.

Example:

CacheMaxFileSize 500000

CacheMinFileSize

Description: The minimum size (in bytes) of a document to be placed in the cache
Syntax: CacheMinFileSize bytes
Default: CacheMinFileSize 1
Context: server config, virtual host
Module: mod_disk_cache

The CacheMinFileSize directive sets the minimum size, in bytes, for a document to be considered for storage in the cache.

Example:

CacheMinFileSize 100

CacheRoot

Description: The directory root under which cache files are stored
Syntax: CacheRoot directory
Context: server config, virtual host
Module: mod_disk_cache

CacheRoot directive defines the name of the directory on the disk to contain cache files. If mod_disk_cache module has been loaded in the Helicon Ape configuration, this directive must be defined. Failing to provide a value for CacheRoot will result in a configuration file processing error. The CacheDirLevels and CacheDirLength directives define the structure of the directories under the specified root directory.

Example:

CacheRoot c:/inetpub/cache