Cache::Null(3pm)

πŸ“¦
version 2.11 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Cache::Null ✨

okay bestie, welcome to Cache::Null β€” the null implementation of the Cache interface πŸ’– this is from the User Contributed Perl Documentation corner of the perl universe (3pm gang, we ride at dawn πŸŒ…).


🌸 NAME 🌸

Cache::Null β€” the null implementation of the Cache interface. yes it's giving "cache" but make it nothing πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

use Cache::Null;

my $cache = Cache::Null->new();

and like, for the actual usage synopsis, go peek at Cache okay? she has the full tea β˜•


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: the Cache::Null class implements the Cache interface, but it does not actually persist data. not even a little. not even one crumb πŸͺπŸ’€

which is lowkey iconic when you're developing and debugging a system and you just want to easily turn off caching β€” flip it to null and boom, cache is gone, no drama ✨

as a result, all calls return results indicating that there is no data stored. that's it. that's the whole bit. no cap πŸ™ˆ


πŸ’– CONSTRUCTOR πŸ’–

my $cache = Cache::Null->new( %options )

the constructor takes cache properties as named arguments, for example:

my $cache = Cache::Null->new( default_expires => '600 sec' );

see 'PROPERTIES' below, and in the Cache documentation, for a list of all the available properties you can set 🫢

but bestie, real talk: it should be noted that all the existing properties β€” like default_expires β€” have no effect in a Null cache. zero. nada. they're just there being pretty 🌈

πŸ‘‘ METHODS πŸ‘‘

see 'Cache' for the API documentation, mwah πŸ’‹


🌈 SEE ALSO 🌈

  • Cache

πŸ’œ AUTHOR πŸ’œ

  • Chris Leishman <chris@leishman.org>
  • Based on work by DeWitt Clinton <dewitt@unto.net>

Copyright (C) 2003-2006 Chris Leishman. All Rights Reserved.

this module is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. this program is free software; you can redistribute or modify it under the same terms as Perl itself πŸͺ✨

$Id: Null.pm,v 1.4 2006/01/31 15:23:58 caleishm Exp $

okay that's the whole page bestie, and if you made it to the end you're literally the main character πŸ’…πŸŒΊ this lil masterpiece is from perl v5.34.0, dated 2022-06-09, and yes it's Cache::Null(3pm) β€” periodt πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from