mod_mem_cache

Overview

This module requires mod_cache to be enabled. It acts as a supporting module for mod_cache and implements memory-based storage engine. mod_mem_cache is most useful when used to cache locally generated content or backend server content.

mod_mem_cache uses System.Web.Caching class for caching. This cache class has separate storages for each http-application (application pool). So, for each current request System.Web.Caching uses the cache storage of the application which handles the request. Similarly, cache cleaning using cache-clear environment variable empties the cache for http-application of the current request (request that triggered cache cleaning).

Quick start

To enable memory-based storage engine for mod_cache use this minimum httpd.conf configuration:

CacheEnable mem /myapp/

or myapp direcotory .htaccess configuration:

CacheEnable mem
# or via env
SetEnv cache-enable mem

This configuration clears cache on specified request. Request must contain 'cache_clear_request' in query string:

SetEnvIf Query_String cache_clear_request cache-clear=1

Related articles and topics

Directives

Name Context Description
MCacheMaxObjectSize S V D .h maximum size in bytes of a document allowed in cache
MCacheMinObjectSize S V D .h minimum size in bytes of a document allowed in cache

Warning! Apache directives

  • MCacheMaxObjectCount
  • MCacheMaxStreamingBuffer
  • MCacheRemovalAlgorithm
  • MCacheSize

are not supported!

MCacheMaxObjectSize

MCacheMaxObjectSize directive sets the maximum allowable size, in bytes, of a document for it to be considered cacheable.

Syntax

MCacheMaxObjectSize bytes

Default

MCacheMaxObjectSize 10000000

MCacheMinObjectSize

MCacheMaxObjectSize directive sets the minimum allowable size, in bytes, of a document for it to be considered cacheable.

Syntax

MCacheMinObjectSize bytes

Default

MCacheMinObjectSize 0