NAME

Articulate::Caching::Native - cache content in memory

DESCRIPTION

This implements caching by keeping an hash of the content you wish to cache in memory.

No attempt is made to monitor the memory size of the hash directly, but a maximum number of locations under which content may be stored is set. Once this maximum is reached or exceeded, a quarter of the keys are removed (preserving those which have most recently been accessed).

Consequently, it is unsuitable for cases where large documents are to be stored alongside small ones, or where you have a very large number of locations you want to cache.

ATTRIBUTES

cache

This is the contents of the cache. Don't set this.

max_keys

The maximum number of keys in the hash (locations for which either meta or content or both is stored).

Be warned that each time this is exceeded, a sort is performed on the values (to find the entries least recently accessed). The larger max_keys is, the longer this sort will take.

METHODS

is_cached

$caching->is_cached( $what, $location )

get_cached

$caching->get_cached( $what, $location )

set_cache

$caching->set_cache( $what, $location, $value )

clear_cache

$caching->clear_cache( $what, $location )

empty_cache

$caching->empty_cache( $what, $location )