-
-
21 Oct 2021 11:53:53 UTC
- Distribution: Mojolicious
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (1961 / 52 / 38)
- Kwalitee
Bus factor: 6- 90.53% Coverage
- License: artistic_2
- Perl: v5.16.0
- Activity
24 month- Tools
- Download (821.64KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Mojo::Cache - Naive in-memory cache
SYNOPSIS
use Mojo::Cache; my $cache = Mojo::Cache->new(max_keys => 50); $cache->set(foo => 'bar'); my $foo = $cache->get('foo');
DESCRIPTION
Mojo::Cache is a naive in-memory cache with size limits.
ATTRIBUTES
Mojo::Cache implements the following attributes.
max_keys
my $max = $cache->max_keys; $cache = $cache->max_keys(50);
Maximum number of cache keys, defaults to
100
. Setting the value to0
will disable caching.METHODS
Mojo::Cache inherits all methods from Mojo::Base and implements the following new ones.
get
my $value = $cache->get('foo');
Get cached value.
set
$cache = $cache->set(foo => 'bar');
Set cached value.
SEE ALSO
Module Install Instructions
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm Mojolicious
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.