Plack:...:Cache(3pm)
π Plack::Middleware::Cache β bestie edition π
ok so this is Plack::Middleware::Cache from the Perl world (that's the 3pm manual, iykyk) and its whole vibe is: use cached responses of certain URIs. no cap. π
β¨ SYNOPSIS β¨
builder {
enable "Cache",
match_url => [
'^/foo/',
'\\?.*xxx=.*',
],
cache_dir => '/tmp/plack-cache';
$app;
};
πΈ DESCRIPTION πΈ
okay so listen π this middleware is literally the friend who remembers everything so you don't have to. it lets you cache those expensive and non-changing responses β you know, the ones that take forever to cook but never actually change β for URIs that match a list of regular expression patterns. the way that it just... holds onto them for you? iconic. π
π«Ά PARAMETERS π«Ά
here's the tea, the following parameters can be used:
match_url(required) β a regexp string or array ref of regexp strings to try to match the current URL against. yes bestie, you can hand it one or hand it a whole list. βcache_dir(optional) β a directory to write the cached responses into. that's it, that's the whole job. πdebug(optional) β set to1to warn cache information. not me being nosy about what's happening in the cache... π
π THANKS π
big slay shoutout to Strategic Data for supporting the writing and release of this module. we love a supportive king. π«Άβ¨
π AUTHOR π
Ingy dΓΆt Net <ingy@cpan.org> β main character energy fr fr. π
π COPYRIGHT AND LICENSE π
Copyright 2011-2014. Ingy dΓΆt Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
okay that's the whole page bestie, go forth and cache responsibly π β¨
and that's a wrap! this little manual page is from perl v5.36.0, dated 2022-12-11, and it was served to you by the User Contributed Perl Documentation collection. slay, bye! π¦π
π¦ where this page comes from
- debian bookworm: libplack-middleware-cache-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libplack-middleware-cache-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libplack-middleware-cache-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libplack-middleware-cache-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libplack-middleware-cache-perl 0.19-2 Β· 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