- Overview
- Installation & Uninstallation
- Local and remote management using IIS 7
- Context and processing order
- Apache compatibility
- Modules
- core functions
- mod_antibot
- mod_asis
- mod_auth_basic
- mod_auth_digest
- mod_authn_anon
- mod_authn_dbd
- mod_authn_default
- mod_authn_file
- mod_authz_default
- mod_authz_groupfile
- mod_authz_host
- mod_authz_user
- mod_cache
- mod_dbd
- mod_deflate
- mod_developer
- mod_dir
- mod_disk_cache
- mod_env
- mod_evasive
- mod_expires
- mod_filter
- mod_gzip
- mod_headers
- mod_hotlink
- mod_linkfreeze
- mod_log_config
- mod_logio
- mod_mem_cache
- mod_mime
- mod_proxy
- mod_replace
- mod_rewrite
- mod_seo
- mod_setenvif
- mod_so
- mod_speling
- mod_usertrack
- mod_xsendfile
- Articles
- Release history
- Troubleshooting
- License agreement
mod_disk_cache
Overview
mod_disk_cache
implements a disk-based storage engine for
mod_cache
.
Quick start
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
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).
Cache can also be cleared with a special request, that sets environment variable
cache-clear
:
# clear cache if query string contains 'clear_cache_request' and client ip is 11.22.33.44
SetEnvIf (Query_String clear_cache_request) and (Remote_Addr 11\.22\.33\.44) cache-clear=1
Related articles and topics
- Web Caching: what is it?
- How mod_cache works?
- Guide: Example of mod_cache application
- Disk-based caching for IIS7
- mod_cache
- mod_mem_cache
- mod_env
- mod_setenvif (extended syntax supported)
- mod_expires
- mod_headers
Directives
Name | Context | Description |
---|---|---|
CacheDirLength | S V D .h | The number of characters in subdirectory names |
CacheDirLevels | S V D .h | The number of levels of subdirectories in the cache. |
CacheMaxFileSize | S V D .h | The maximum size (in bytes) of a document to be placed in the cache |
CacheMinFileSize | S V D .h | The minimum size (in bytes) of a document to be placed in the cache |
CacheRoot | S V D .h | The directory root under which cache files are stored |
CacheDirLength
The number of characters in subdirectory names
The
CacheDirLength
directive sets the number of characters for each subdirectory name in the cache hierarchy.
Syntax
CacheDirLength length
Default
CacheDirLength 2
CacheDirLevels
The number of levels of subdirectories in the 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.
Syntax
CacheDirLevels levels
Default:
CacheDirLevels 3
CacheMaxFileSize
The maximum size (in bytes) of a document to be placed in the cache
The
CacheMaxFileSize
directive sets the maximum size, in bytes, for a document to be considered for storage in the cache.
Syntax
CacheMaxFileSize bytes
Default
# 1048576 = 1Mb
CacheMaxFileSize 1048576
CacheMinFileSize
The minimum size (in bytes) of a document to be placed in the cache
The
CacheMinFileSize
directive sets the minimum size, in bytes, for a document to be considered for storage in the cache.
Syntax
CacheMinFileSize bytes
Default
CacheMinFileSize 1
CacheRoot
The directory root under which cache files are stored
Syntax
CacheRoot directory
Description
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