Module mod_mmap_dynamic


This module provides for reverse caching of dynamically generated content.

Status: External module
Source file: mod_mmap_dynamic.c
Module identified: mod_mmap_dynamic

Summary

Reverse caching is the act of providing a cache server for content generators at the Web Service Providers end rather
than the traditional ISP cache. It is designed for reducing load on servers that generate content.

The module is designed to be run on the same web server as content is generated from and uses Internal Redirects
to cache the content.

Directives





CacheTime Directive

Syntax: CacheTime seconds
Context: Directory config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets the time in seconds that content in the directory should be cached before being flagged as stale and
reloaded from the origin server.

Example:

CacheTime 300


CacheUseModProxy

Syntax: CacheUseModProxy ON|OFF
Context: Directory config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets a flag as to whether mod_proxy should be used for the internal redirects. This is used if the content is
generated by another server or you wish to separate the two functions out.


HashPrime

Syntax: HashPrime number
Context: Root Server config
Status: External module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets the prime number to be used in the hash function as a modulus. Any number can be used but performance may be
impacted if several pages hash the same.

Example:

HashPrime 31


CacheRAMSize

Syntax: CacheRAMSize number (in mb)
Context: Root Server config
Status: External module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets the amount of memory used for storing compressed and uncompressed pages in the cache. At 90% full cleanups
will run and remove old pages from the cache.

Example:

CacheRAMSize 64



CachePageRAMSize

Syntax: CachePageRAMSize number (in mb)
Context: Root Server config
Status: External module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets the amount of memory to be used by the hashtable and the page data structures. This should be a lot smaller
than CacheRAMSize - it equates to about 2mb per 64mb of CacheRAMSize. Reason for it is to reduce fragmentation
as these structures are rarely freed while the content is updated quite frequently.

Example:

CachePageRAMSize 2



CacheOn

Syntax: CacheOn ON|OFF
Context: Directory config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

This sets a flag that determines whether or not content for a directory is cached. If it is not cached then the
normal handlers for it will take effect. If mod_proxy is in use this the request structure and handler are redone
to get mod_proxy to handle the request. Requests with Caching Off are not compressed.


CacheNoCompress

Syntax: CacheNoCompress type1 type2 .....
Context: Directory config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

This sets mime types that are not compressed when content is generated. The data here is compared to the content
type of the request if it matches then compression is not done. * represents any string of characters and ?
represents an individual character.

Example:

CacheNoCompress image/jpeg


CacheAllowNoCache

Syntax: CacheAllowNoCache machine1 machine2 .....
Context: Directory config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets an address to compare to the address of the user, if the address matches then a Pragma: no-cache will
result in the content being regenerated. It is normally ignored. * represents any string of characters and ?
represents and individual character. This does not actually convert it to an ip address so 10. will not work
10.* would be necessary.

Example:

CacheAllowNoCache 192.168.0.*


CacheContentServer

Syntax: CacheContentServer servername
Context: Directory config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Allows the mounting of content from other machines rather than using the servername variable. Any content
requested will be directed to the server listed here. This only works when the mod_proxy functionality is used
otherwise the directive is silently ignored.

Example:

CacheContentServer thismachine.foo.com


CacheLowThreshold

Syntax: CacheLowThreshold number (between 1 and 100)
Context: Root Server config
Status: External Module
Module:i mod_mmap_dynamic
Compatability : Apache 1.3.24 or later.

Sets the limit to what free memory can get to before the memory management cleanups are invoked. This is a
percentage of total memory allowed for CacheRamSize and CachePageRamSize. Cleanups run when either of these
values are less than the threshold.

Example:

CacheLowThreshold 75


CacheHighThreshold

Syntax: CacheHighThreshold number (between 1 and 100)
Context: Root Server config
Status: External Module
Module: mod_mmap_dynamic
Compatability: Apache 1.3.24 or later.

Sets the threshold to reclaim memory to after running cleanups. Pages will be freed until this threshold is
reached for both CacheRamSize and CachePageRamSize.

Example:

CacheHighThreshold 90