GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOJO::CACHE (3)

.ds Aq ’

NAME

Mojo::Cache - Naive in-memory cache

CONTENTS

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 to 0 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

Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOJO::CACHE (3) 2016-03-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.