NAME

Mojo::Cache - Memory Cache

SYNOPSIS

use Mojo::Cache;

my $cache = Mojo::Cache->new('Hello!');
$cache->add_chunk('World!');
print $cache->slurp;

DESCRIPTION

Mojo::Cache is a generic container for in-memory data.

ATTRIBUTES

cache_length

my $cache_length = $cache->cache_length;

content

my $handle = $cache->content;
$cache     = $cache->content('Hello World!');

METHODS

Mojo::Cache inherits all methods from Mojo::Base and implements the following new ones.

add_chunk

$cache = $cache->add_chunk('test 123');

contains

my $contains = $cache->contains('random string');

get_chunk

my $chunk = $cache->get_chunk($offset);

slurp

my $string = $cache->slurp;