Plack:...:Cache(3pm)

πŸ“¦
version 0.19 Β· 2 versions
  • 0.19 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.19 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 to 1 to 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 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