Koha::Cache::Memory::Lite - Handling caching of objects in memory *only* for Koha
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();
Koha in memory only caching routines.
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.
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.
$cache->set_in_cache($key, $value);
Save a value to the specified key in the cache.
$cache->clear_from_cache($key);
Remove the value identified by the specified key from the lite cache.
my @keys = $cache->all_keys();
Returns an array of all keys currently in the lite cache.
$cache->flush();
Clear the entire lite cache.