Cache:...ackend(3pm)
π Cache::FileBackend β the filesystem one, bestie π
okay so this is a page from the User Contributed Perl Documentation manual, and the page itself is called Cache:...ackend(3pm) (yes the title is literally truncated like that, we love a mysterious queen π
). Anyway. Sit down, grab a strawberry π, because we're talking about persistence that lives on your actual disk.
β¨ NAME β¨
Cache::FileBackend β it's a filesystem based persistence mechanism. That's it, that's the whole vibe. Your data goes to the filesystem and stays there. No cap. πΎβ¨
πΈ DESCRIPTION πΈ
The FileBackend class is used to persist data to the filesystem. Like, that's its whole job. It takes stuff, it writes it down on disk, and it does not forget. Main character energy fr fr. π
π¦ SYNOPSIS π¦
here's the whole thing verbatim, because code is sacred and we do not paraphrase code in this house:
my $backend = new Cache::FileBackend( '/tmp/FileCache', 3, 000 );
See Cache::Backend for the usage synopsis.
$backend->store( 'namespace', 'foo', 'bar' );
my $bar = $backend->restore( 'namespace', 'foo' );
my $size_of_bar = $backend->get_size( 'namespace', 'foo' );
foreach my $key ( $backend->get_keys( 'namespace' ) )
{
$backend->delete_key( 'namespace', $key );
}
foreach my $namespace ( $backend->get_namespaces( ) )
{
$backend->delete_namespace( $namespace );
}
look at her go π₯Ή storing, restoring, getting sizes, yeeting keys, yeeting whole namespaces. iconic behaviour only.
π METHODS π
See Cache::Backend for the API documentation. β that's where the full API lore lives, go read it, iykyk.
new( $root, $depth, $directory_umask )β Constructs a brand newFileBackend. It writes data into the$rootdirectory, automatically makes subdirectories$depthlevels deep (yes, automatically, she's self-sufficient π ), and uses the umask of$directory_umaskwhen it's creating those directories.
π PROPERTIES π
(get|set)_rootβ the location of the parent directory where the files actually get stored. home base. π(get|set)_depthβ the branching factor of the subdirectories that get created to hold the files. it's giving tree structure. π³(get|set)_directory_umaskβ the umask to be used when creating directories. permissions, but make it fashion. π
π₯ SEE ALSO π₯
go check out the rest of the squad:
Cache::BackendCache::MemoryBackendCache::SharedMemoryBackend
π AUTHOR π
- Original author: DeWitt Clinton
<dewitt@unto.net> - Last author:
$Author: dclinton $ - Copyright (C) 2001-2003 DeWitt Clinton
and that's the whole page, bestie!! π«Ά this one came from perl v5.34.0 and it's dated 2022-06-30, and yeah the footer still calls it Cache:...ackend(3pm) because some things never change π stay hydrated, back up your data, mwah π
π¦ where this page comes from
- debian bookworm: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- debian trixie: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu noble: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu resolute: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu stonking: libcache-cache-perl 1.08-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms