From: Andre Malo
mod_disk_cachemod_proxymod_mem_cachemod_mem_cache can be configured to operate in two
modes: caching open file descriptors or caching objects in heap storage.
- mod_mem_cache is most useful when used to cache
- locally generated content or to cache backend server content for
- mod_proxy configured for ProxyPass (aka reverse proxy)mod_mem_cache can be used to cache locally generated content
+ or to cache backend server content for mod_proxy when
+ configured using ProxyPass
+ (aka reverse proxy)Content stored and retrived keyed to the URL. Content with - access protections is not cached.
+Content is stored in and retrieved from the cache using URI based keys. Content with + access protection is not cached.
CacheDefaultExpire
CacheDisable
CacheEnable| Description: - | The default time in seconds to cache a document |
|---|---|
| Syntax: + | The default duration to cache a document when no expiry date is specified. |
| Syntax: | CacheDefaultExpire seconds |
| Default: | CacheDefaultExpire 3600 (one hour) |
| Context: | server config, virtual host |
| Status: | Experimental |
| Module: | mod_cache |
The default time in seconds to cache a document if the page does not have
- an expiry date in the Expires field.
The CacheDefaultExpire directive specifies a default time,
+ in seconds, to cache a document if neither an expiry date nor last-modified date are provided
+ with the document. The value specified with the CacheMaxExpire
+ directive does not override this setting.
CacheDefaultExpire 86400
| Description: - | Disable caching of specified URLs by specified storage -manager |
|---|---|
| Syntax: - | CacheDisable cache_type url-string |
| Context: + | Disable caching of specified URLs |
| Syntax: + | CacheDisable url-string |
| Context: | server config, virtual host |
| Status: | Experimental |
| Module: | mod_cache |
- CacheDisable disk /local_files
+ CacheDisable /local_files
| Description: - | Enable caching specified URLs in a specified storage + | Enable caching of specified URLs using a specified storage manager |
|---|---|---|
| Syntax: | CacheEnable cache_type url-string | |
| Context: | server config, virtual host | |
| Status: @@ -114,71 +115,121 @@ manager | ||
| Syntax: | mod_cache |
The CacheEnable directive instructs
mod_cache to cache urls at or below
- url-string. The cache store is specified with the
- cache_type argument. cache_type mem
- instructs mod_cache to use the in-memory cache storage
- manager implemented by mod_mem_cache.
+ url-string. The cache storage manager is specified with the
+ cache_type argument. cache_type mem
+ instructs mod_cache to use the memory based storage
+ manager implemented by mod_mem_cache.
cache_type disk instructs
- mod_cache to use the cache storage manager implemented
- by mod_disk_cache.
mod_cache to use the disk based storage manager
+ implemented by mod_disk_cache.
+ cache_type fd instructs
+ mod_cache to use the file descriptor cache implemented
+ by mod_mem_cache.
+ In the event that the URL space overlaps between different
+ CacheEnable directives (as in the example below),
+ each possible storage manager will be run until the first one that
+ actually processes the request. The order in which the storage managers are
+ run is determined by the order of the CacheEnable
+ directives in the configuration file.
- CacheEnable disk /
CacheEnable mem /manual
CacheEnable fd /images
+ CacheEnable disk /
| Description: - | Percentage of download to arrive for the cache to force -complete transfer |
|---|---|
| Syntax: + | Percentage of document served, after which the server +will complete caching the file even if the request is cancelled. |
| Syntax: | CacheForceCompletion Percentage |
| Default: | CacheForceCompletion 60 |
| Context: | server config, virtual host |
| Status: | Experimental |
| Module: | mod_cache |
Percentage of download to arrive for the cache to force complete transfer.
+Ordinarily, if a request is cancelled while the response is being
+ cached and delivered to the client the processing of the response will
+ stop and the cache entry will be removed. The
+ CacheForceCompletion directive specifies a
+ threshold beyond which the document will continue to be cached to
+ completion, even if the request is cancelled.
The threshold is a percentage specified as a value between
+ 1 and 100. A value of 0
+ specifies that the default be used. A value of 100
+ will only cache documents that are served in their entirety. A value
+ between 60 and 90 is recommended.
CacheForceCompletion 80
| Description: - | Ignore requests from the client for uncached -content |
|---|---|
| Syntax: + | Ignore the fact that the client requested the content not be +cached. |
| Syntax: | CacheIgnoreCacheControl On|Off |
| Default: | CacheIgnoreCacheControl Off |
| Context: | server config, virtual host |
| Status: | Experimental |
| Module: | mod_cache |
Ignore requests from the client for uncached content
+Ordinarily, documents with no-cache or no-store header values will not be stored in the cache.
+ The CacheIgnoreCacheControl directive allows this behavior to be overridden.
+ CacheIgnoreCacheControl On tells the server to attempt to cache the document
+ even if it contains no-cache or no-store header values. Documents requiring authorization will
+ never be cached.
CacheIgnoreCacheControl On
| Description: - | Ignore responses where there is no Last Modified -Header |
|---|---|
| Syntax: + | Ignore the fact that a response has no Last Modified +header. |
| Syntax: | CacheIgnoreNoLastMod On|Off |
| Default: | CacheIgnoreNoLastMod Off |
| Context: | server config, virtual host |
| Status: | Experimental |
| Module: | mod_cache |
Ignore responses where there is no Last Modified Header.
+Ordinarily, documents without a last-modified date are not cached.
+ Under some circumstances the last-modified date is removed (during
+ mod_include processing for example) or not provided
+ at all. The CacheIgnoreNoLastMod directive
+ provides a way to specify that documents without last-modified dates
+ should be considered for caching, even without a last-modified date.
+ If neither a last-modified date nor an expiry date are provided with
+ the document then the value specified by the
+ CacheDefaultExpire directive will be used to
+ generate an expiration date.
CacheIgnoreNoLastMod On
| Description: - | The factor used to estimate the Expires date from the -LastModified date |
|---|---|
| Syntax: + | The factor used to compute an expiry date based on the +LastModified date. |
| Syntax: | CacheLastModifiedFactor float |
| Default: | CacheLastModifiedFactor 0.1 |
| Context: | server config, virtual host |
| Status: | Experimental |
| Module: | mod_cache |
The factor used to estimate the Expires date from the LastModified date.
+In the event that a document does not provide an expiry date but does
+ provide a last-modified date, an expiry date can be calculated based on
+ the time since the document was last modified. The
+ CacheLastModifiedFactor directive specifies a
+ factor to be used in the generation of this expiry date
+ according to the following formula:
+
+ expiry-period = time-since-last-modified-date * factor
+ expiry-date = current-date + expiry-period
+
+ For example, if the document was last modified 10 hours ago, and
+ factor is 0.1 then the expiry-period will be set to
+ 10*0.1 = 1 hour. If the current time was 3:00pm then the computed
+ expiry-date would be 3:00pm + 1hour = 4:00pm.
+
+ If the expiry-period would be longer than that set by
+ CacheMaxExpire, then the latter takes
+ precedence.
CacheLastModifiedFactor 0.5
@@ -190,9 +241,10 @@ LastModified date
The maximum time in seconds to cache a document. The
- CacheMaxExpire takes precedence over the
- Expires field from the header.
The CacheMaxExpire directive specifies the maximum number of
+ seconds for which cachable HTTP documents will be retained without checking the origin
+ server. Thus, documents will be out of date at most this number of seconds. This maximum
+ value is enforced even if an expiry date was supplied with the document.
Maximum number of bytes of a streamed response (i.e., a
- response where the entire content is not available all at once, such
- as a proxy or CGI response) to buffer before deciding if the response
- is cacheable. By default, a streamed response will not be
- cached unless it has a The Using a nonzero value for Apache HTTP Server Version 2.0 Content stored and retrived keyed to the URL. Content with
- access protections is not cached. Content is stored in and retrieved from the cache using URI based keys. Content with
+ access protection is not cached. The CacheDirLevels*CacheDirLength value must not be higher than 20. The result of The CacheDirLevels*CacheDirLength value must not be higher than 20. The result of More detail will be added here, when the function is implemented. More detail will be added here, when the function is implemented. More detail will be added here, when the function is implemented. The More detail will be added here, when the function is implemented. More detail will be added here, when the function is implemented. More detail will be added here, when the function is implemented. The The The The The More detail will be added here, when the function is implemented.
CacheMaxExpire 604800
@@ -205,15 +257,22 @@ before declaring the response uncacheableStatus:
Experimental
- Module:
mod_cache Content-Length header. The reason
- for this is to avoid using a large amount of memory to buffer a partial
- response that might end up being too large to fit in the cache anyway.
- To enable caching of streamed responses, use CacheMaxStreamingBuffer to specify the maximum amount of
- buffer space to use per request.CacheMaxStreamingBuffer directive
+ specifies the maximum number of bytes of a streamed response to
+ buffer before deciding that the response is too big to cache.
+ A streamed response is one in which the entire content is not
+ immediately available and in which the Content-Length
+ may not be known. Sources of streaming responses include proxied
+ responses and the output of CGI scripts. By default, a streamed
+ response will not be cached unless it has a
+ Content-Length header. The reason for this is to
+ avoid using a large amount of memory to buffer a partial response
+ that might end up being too large to fit in the cache.
+ The CacheMaxStreamingBuffer directive allows
+ buffering of streamed responses that don't contain a
+ Content-Length up to the specified maximum amount of
+ space. If the maximum buffer space is reached, the buffered
+ content is discarded and the attempt to cache is abandoned.Note:
CacheMaxStreamingBuffer will not delay the transmission
diff --git a/docs/manual/mod/mod_disk_cache.html.en b/docs/manual/mod/mod_disk_cache.html.en
index 46a4b2b4849..908d7f86482 100644
--- a/docs/manual/mod/mod_disk_cache.html.en
+++ b/docs/manual/mod/mod_disk_cache.html.en
@@ -5,20 +5,22 @@
This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-->
Apache Module mod_disk_cache
Description:
- Content cache keyed to URIs Status:
+ Content cache storage manager keyed to URIs Status:
Experimental Module Identifier:
disk_cache_module Source File:
mod_disk_cache.c Summary
+ mod_disk_cache implements a disk based storage manager for use with mod_proxy.mod_disk_cache requires the services of mod_cache.mod_disk_cache implements a disk based storage manager. It is primarily of
+ use in conjunction with mod_proxy.Note:
+ mod_disk_cache requires the services of mod_cache.Directives
CacheDirLength
CacheDirLevels
CacheExpiryCheck
CacheTimeMarginCacheDirLength Directive
Description:
The number of characters in subdirectory names Syntax:
- CacheDirLength lengthDefault:
+ CacheDirLength lengthDefault:
CacheDirLength 2Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheDirLength directive sets the number of
- characters for each subdirectory in the cache
- CacheDirLength 4
-CacheDirLevels*
+ CacheDirLength must not be higher than 20.
+ CacheDirLength 4
+ CacheDirLevels Directive
Description:
- The number of levels of subdirectories in the cache Syntax:
- CacheDirLevels levelsDefault:
+ The number of levels of subdirectories in the cache. Syntax:
+ CacheDirLevels levelsDefault:
CacheDirLevels 3Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheDirLevels directive sets the number of
- subdirectory levels in the cache. Cached data will be saved this many directory
- levels below CacheRootCacheRoot directory.
-
- CacheDirLevels 5
-CacheDirLevels*
+ CacheDirLength must not be higher than 20.
+ CacheDirLevels 5
+ CacheExpiryCheck Directive
+ Description:
- On if cache observes Expires date when seeking files Syntax:
- CacheExpiryCheck binaryDefault:
- CacheExpiryCheck ?Context:
- server config Status:
+ Indicates if the cache observes Expires dates when seeking
+files Syntax:
+ CacheExpiryCheck On|OffDefault:
+ CacheExpiryCheck OnContext:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache
- CacheExpiryCheck On
-CacheExpiryCheck directive is currently not implemented.
-
+ CacheExpiryCheck Off
+ CacheExpiryCheck directive is currently
+ not implemented.
+ CacheGcClean Directive
+ Description:
- The time in hours to retain unchanged files that match a url Syntax:
- CacheGcClean hoursDefault:
+ The time to retain unchanged cached files that match a URL Syntax:
+ CacheGcClean hours url-stringDefault:
CacheGcClean ?Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache
- CacheGcClean
-CacheGcClean directive is currently not implemented.
-
+ CacheGcClean 12 /daily_scripts
+ CacheGcClean directive is currently
+ not implemented.
+ CacheGcDaily Directive
+ Description:
- The time of day for garbage collection (24 hour clock) Syntax:
- CacheGcDaily timeDefault:
+ The recurring time each day for garbage collection to be run.
+(24 hour clock) Syntax:
+ CacheGcDaily timeDefault:
CacheGcDaily ?Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache
- CacheGcDaily
-CacheGcDaily directive is currently not implemented.
-
+ CacheGcDaily 23:59
+ CacheGcDaily directive is currently
+ not implemented.
+ CacheGcInterval Directive
+ Description:
- The interval between garbage collections Syntax:
- CacheGcInterval hoursContext:
- server config Status:
+ The interval between garbage collection attempts. Syntax:
+ CacheGcInterval hoursContext:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheGcInterval directive specifies the
+ number of hours to wait between attempts to free up disk space.
- CacheGcInterval 24
-CacheGcInterval directive is currently not implemented.
-
+ CacheGcInterval 24
+ CacheGcInterval directive is currently
+ not implemented.
+ CacheGcMemUsage Directive
+ Description:
The maximum kilobytes of memory used for garbage collection Syntax:
- CacheGcMemUsage KBytesDefault:
+ CacheGcMemUsage KBytesDefault:
CacheGcMemUsage ?Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache
- CacheGcMemUsage
-CacheGcMemUsage directive is currently not implemented.
-
+ CacheGcMemUsage 16
+ CacheGcMemUsage directive is currently
+ not implemented.
+ CacheGcUnused Directive
+ Description:
- The time in hours to retain unused file that match a url Syntax:
- CacheGcUnused hoursDefault:
+ The time to retain unreferenced cached files that match a URL. Syntax:
+ CacheGcUnused hours url-stringDefault:
CacheGcUnused ?Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache
- CacheGcUnused
-CacheGcUnused directive is currently not implemented.
-
+ CacheGcUnused 12 /local_images
+ CacheGcUnused directive is currently
+ not implemented.
+ CacheMaxFileSize Directive
Description:
- The maximum size (in bytes) of a file to be placed in the cache Syntax:
- CacheMaxFileSize bytesDefault:
+ The maximum size (in bytes) of a document to be placed in the
+cache Syntax:
+ CacheMaxFileSize bytesDefault:
CacheMaxFileSize 1000000Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheMaxFileSize directive sets the maximum
- size in bytes of a file to be cached.
- CacheMaxFileSize 64000
-
+ CacheMaxFileSize 64000
+ CacheMinFileSize Directive
Description:
- The minimum size (in bytes) of a file to be placed in the cache Syntax:
- CacheMinFileSize bytesDefault:
+ The minimum size (in bytes) of a document to be placed in the
+cache Syntax:
+ CacheMinFileSize bytesDefault:
CacheMinFileSize 1Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheMinFileSize directive sets the minimum
- size in bytes of a file to be cached.
- CacheMinFileSize 64
-
+ CacheMinFileSize 64
+ CacheRoot Directive
- Description:
The directory root under which cache files are stored Syntax:
- CacheRoot directoryDefault:
+ CacheRoot directoryDefault:
noneContext:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheRoot directive defines the name of the directory
- on the disk to contain cache files. If the mod_disk_cache 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
+ CacheRoot directive defines the name of the
+ directory on the disk to contain cache files. If the
+ mod_disk_cache 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 error. The CacheDirLevels and
- CacheDirLength directives define the structure of the directories
- under the specified root directory.CacheDirLength directives define the structure of
+ the directories under the specified root directory.
-
- CacheRoot c:/cacheroot
-
+ CacheRoot c:/cacheroot
+ CacheSize Directive
Description:
The maximum amount of disk space that will be used by the cache in KBytes Syntax:
- CacheSize KBytesDefault:
+ CacheSize KBytesDefault:
CacheSize 1000000Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache CacheSize directive sets the desired disk space
@@ -210,13 +241,19 @@ The CacheGcUnused directive is currently not<
CacheTimeMargin Directive
+ Description:
The minimum time margin to cache a document Syntax:
- CacheTimeMargin ?Default:
+ CacheTimeMargin ?Default:
CacheTimeMargin ?Context:
- server config Status:
+ server config, virtual host Status:
Experimental Module:
mod_disk_cache
- CacheTimeMargin
-
+ CacheTimeMargin X
+ CacheTimeMargin directive is currently
+ not implemented.
+