Cache::FileCache(3pm)
π Cache::FileCache π
okay bestie, welcome to Cache::FileCache(3pm) β yes that's the section 3pm perl manpage, and yes we're gonna have a time β¨
πΈ NAME πΈ
Cache::FileCache β the class that implements the Cache interface. that's it, that's the whole name section, she's short and she knows it π
π¦ DESCRIPTION π¦
so. the FileCache class implements the Cache interface. the way it works is it stores your data in the filesystem, which means β and this is the slay part β it can be shared between processes π₯
like, multiple processes, same cache, no drama. iconic behaviour honestly.
β¨ SYNOPSIS β¨
here's the vibe, copy-paste core:
use Cache::FileCache;
my $cache = new Cache::FileCache( { 'namespace' => 'MyNamespace',
'default_expires_in' => 600 } );
and for the full usage synopsis, go look at Cache::Cache β she's got the whole thing π«Ά
π METHODS π
the API documentation lives in Cache::Cache, bestie. but here's what FileCache brings to the function list:
Clear( [$cache_root] )β checkCache::Cache, except this one takes the optional$cache_rootparameter π§ΉPurge( [$cache_root] )β checkCache::Cache, again with the optional$cache_rootparameter πͺοΈSize( [$cache_root] )β checkCache::Cache, and yep, optional$cache_rootparameter π
π OPTIONS π
standard options? those live in Cache::Cache, go say hi π. additionally, you set these options by passing in a reference to a hash containing any of the following keys:
cache_rootβ where in the filesystem the root of the cache lives. defaults to'FileCache'under the OS default temp directory (which is often'/tmp'on UNIXes, iykyk) β unless you explicitly set it πcache_depthβ how many subdirectories deep to cache object item. lowkey important: this should be large enough that no cache directory has more than a few hundred objects. defaults to3unless explicitly set ποΈdirectory_umaskβ the directories in the cache on the filesystem should be globally writable to allow for multiple users. and yeah, that's a potential security concern, no cap β but the actual cache entries are written with the user's umask, which reduces the risk of cache poisoning. if you want it to be user-writable only, set the'directory_umask'option to'077'or something like that. defaults to'000'unless explicitly set π
π PROPERTIES π
default properties? Cache::Cache has them, go read her π
(get|set)_cache_rootβ see the definition above for the optioncache_root(get|set)_cache_depthβ see the definition above for the optioncache_depth(get|set)_directory_umaskβ see the definition above for the optiondirectory_umask
π SEE ALSO π
Cache::Cacheβ the main character, the blueprint, the moment π«
π AUTHOR π
- Original author: DeWitt Clinton
<dewitt@unto.net> - Last author:
$Author: dclinton $ - Copyright (C) 2001-2003 DeWitt Clinton
fr fr that's the whole page, nothing skipped, nothing invented. every option, every default, every'077'and'000'accounted for π―
and that's a wrap, bestie π«Ά this was perl v5.34.0, dated 2022-06-30, and it's the Cache::FileCache(3pm) manpage β periodt π
β¨π
π¦ 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