Jifty:...chable(3pm)
π Jifty::DBI::Record::Cachable β the whole vibe π
okay bestie, welcome to the Jifty:...chable(3pm) page, from the β¨ User Contributed Perl Documentation β¨ collection. it's giving "records with caching behavior" and honestly? iconic. let's get into it. π¦
πΈ NAME πΈ
Jifty::DBI::Record::Cachable β records with caching behavior. yes that's literally the whole name and yes it's exactly what it says on the tin, no cap.
β¨ SYNOPSIS β¨
like, here's how you'd actually use it:
package Myrecord;
use base qw/Jifty::DBI::Record::Cachable/;
that's it. that's the whole setup. periodt. π
π DESCRIPTION π
so this module subclasses the main Jifty::DBI::Record package to add a caching layer on top. think of it like giving your records a little memory of their own. π§ β¨
the public interface stays exactly the same, bestie β nothing new to learn, promise. the one (1) glow-up is this: records that have been loaded in the last few seconds may be reused by subsequent fetch or load methods without retrieving them from the database. so yeah, your DB gets a lil break. she deserves it. π
π METHODS π
π«Ά flush_cache
this is a class method, and it flushes the _global_ Jifty::DBI::Record::Cachable cache. like, the global one. every single cache gets immediately expired. all of them. gone. bye. π
π₯ _flush_key_cache
blows away this record type's key cache. just the one record type, not the whole world. very targeted, very demure. π
β load_from_hash
this one overrides the implementation from Jifty::DBI::Record so it can add caching. same energy as the original, just with extra cache sprinkled on top. β¨
π load_by_cols
also overrides the implementation from Jifty::DBI::Record to add caching. twins fr fr. π
π¦ _cache_config
you can override this method to change how long the caching lasts β because the default is 5 seconds and maybe that's just not your girl's timeline, yk? β°
for example, if you wanna cache records for up to 30 seconds, add this method to your class:
sub _cache_config {
{ 'cache_for_sec' => 30 }
}
slay. custom cache duration, exactly how you like it. π
π AUTHOR π
Matt Knopp <mhat@netlag.com> β the icon, the legend, the moment. π«Ά
π SEE ALSO π
Jifty::DBIJifty::DBI::Record
go read those too, bestie, they're part of the lore. πβ¨
and that's a wrap on this lil page π it was living in perl v5.34.0, dated 2022-06-15, filed under Jifty:...chable(3pm) β mwah, take care of her, bye bestie!! πππ
π¦ where this page comes from
- debian bookworm: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms