DBIx::...achable(3pm)
π DBIx::SearchBuilder::Record::Cachable β bestie edition π
okay so this is a page from the User Contributed Perl Documentation collection, and honestly? it's a lil bop. it lives in the DBIx::...achable(3pm) part of your filesystem, and it's about giving your records a memory. like, an actual memory. iconic behavior tbh.
β¨ NAME β¨
DBIx::SearchBuilder::Record::Cachable β Records with caching behavior π
β¨ SYNOPSIS β¨
bestie. look how easy this is. literally two lines:
package MyRecord;
use base qw/DBIx::SearchBuilder::Record::Cachable/;
that's it. that's the whole vibe. you just inherit and you're caching. slay. π
β¨ DESCRIPTION β¨
so here's the tea β β this module subclasses the main DBIx::SearchBuilder::Record package and adds a whole caching layer on top of it. it's giving glow-up, it's giving efficiency, it's giving stop-hitting-the-database-so-much.
the public interface stays exactly the same, no cap. π«Ά the only difference? records that have been loaded in the last few seconds might get reused by later fetch or load methods β so instead of going all the way back to the database to retrieve them again, they just... already exist. we love a shortcut that isn't a safety hazard. β¨
β¨ METHODS β¨
πΈ FlushCache
this is a class method, and it flushes the _global_ DBIx::SearchBuilder::Record::Cachable cache. like, all of them. every single cache. immediately expired, no survivors, no warning, no soft launch. π₯
so if you were emotionally attached to any cached record β goodbye. it's gone. periodt.
π¦ _FlushKeyCache
this one blows away this record type's key cache. just the one. not the whole world, just your little corner of it. π§
π _CacheConfig
okay this is the fun one. you can override this method to change how long the caching lasts, because the default is 5 seconds. five. seconds. it's giving "blink and you'll miss it" energy ngl.
so, for example β say you want to cache records for up to 30 seconds instead. you just add this method to your class:
sub _CacheConfig {
{ 'cache_for_sec' => 30 }
}
and boom π₯ you're caching for a whole thirty seconds like a main character. adjust as your heart desires, bestie. iykyk.
π reminder: that default is 5 seconds and it's swift. don't be out here assuming your cache is gonna hang around longer than it actually does.
and that's the whole page, no skips, no summarising, every option and example intact and accounted for. π
this little masterpiece comes to you courtesy of perl v5.40.1, dated 2026-05-07, filed under DBIx::...achable(3pm). go forth and cache responsibly, bestie. πβ¨ππ¦πΈ
π¦ where this page comes from
- ubuntu stonking: libdbix-searchbuilder-perl 1.85-1 Β· 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