<<

NAME

Koha::Cache::Memory::Lite - Handling caching of objects in memory *only* for Koha

SYNOPSIS

  use Koha::Cache::Memory::Lite;
  my $cache = Koha::Cache::Memory::Lite->get_instance();
  $cache->set($key, $value);
  my $retrieved_from_cache_value = $cache->get($key);
  $cache->clear_from_cache($key);
  $cache->flush();

DESCRIPTION

Koha in memory only caching routines.

get_instance

This gets a shared instance of the lite cache, set up in a very default way. The lite cache is an in memory only cache that's automatically flushed for every request.

get_from_cache

    my $value = $cache->get_from_cache($key);

Retrieve the value stored under the specified key in the cache.

The retrieved value is a direct reference so should not be modified.

set_in_cache

    $cache->set_in_cache($key, $value);

Save a value to the specified key in the cache.

clear_from_cache

    $cache->clear_from_cache($key);

Remove the value identified by the specified key from the lite cache.

all_keys

    my @keys = $cache->all_keys();

Returns an array of all keys currently in the lite cache.

flush

    $cache->flush();

Clear the entire lite cache.

<<