NAME

Mojo::Cache::File - File Cache

SYNOPSIS

use Mojo::Cache::File;

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

DESCRIPTION

Mojo::Cache::File is a generic container for files.

ATTRIBUTES

Mojo::Cache::File inherits all attributes from Mojo::Cache and implements the following new ones.

handle

my $handle = $cache->handle;
$cache     = $cache->handle(IO::File->new);

cache_length

my $cache_length = $cache->cache_length;

METHODS

Mojo::Cache::File inherits all methods from Mojo::Cache 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;