CHI::D...cached(3pm)

πŸ“¦
version 0.16 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

CHI::Driver::Memcached β€” distributed cache via memcached (the memory cache daemon) ✨

okay so quick vibe check: this is the CHI driver that lets you stash your stuff in memcached, and the docs for it live in the CHI::D...cached(3pm) manual page under User Contributed Perl Documentation. bestie, it's giving distributed cache realness πŸ’…


🌸 VERSION 🌸

version 0.16


✨ SYNOPSIS ✨

    use CHI;

    my $cache = CHI->new(
        driver => 'Memcached',   # or 'Memcached::Fast', or 'Memcached::libmemcached'
        namespace => 'products',
        servers => [ "10.0.0.15:11211", "10.0.0.15:11212", "/var/sock/memcached",
        "10.0.0.17:11211", [ "10.0.0.17:11211", 3 ] ],
        debug => 0,
        compress_threshold => 10_000,
    );

that's it. that's the whole setup. slay 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a CHI driver that uses Cache::Memcached to store data in the memcached server(s) you specify. no cap.

also available as part of this same distribution:

  • CHI::Driver::Memcached::Fast
  • CHI::Driver::Memcached::libmemcached

those two work with other Memcached clients and support a similar feature set. and literally all three modules' docs are right here below. one stop shop, we love to see it πŸ’–


πŸŽ€ CONSTRUCTOR OPTIONS πŸŽ€

the namespace, appended with ":", gets passed along to the Cached::Memcached::* constructor β€” plus any constructor options that CHI doesn't recognize, like, for example, servers, compress_threshold and debug.

not me accidentally typo'ing nothing, that Cached::Memcached::* is exactly what the page says, don't come for me πŸ™ˆ

and if you need more control over what gets passed to Cache::Memcached::*? you can just hand it a hash directly via "memd_params". iconic.


πŸ’… METHODS πŸ’…

on top of the standard CHI methods, you also get:

  • memd β€” hands you back a handle to the underlying Cache::Memcached::* object 🫴 so you can call memcached-specific methods that the general API just does not support, e.g.
    $self->memd->incr("key");
    my $stats = $self->memd->stats();

main character energy fr fr.


πŸ’€ UNSUPPORTED METHODS πŸ’€

these standard CHI methods cannot currently be supported by memcached β€” chiefly because there's literally no way to get a list of stored keys 😭 like, the keys are just... gone, bestie.

  • dump_as_hash
  • clear
  • get_keys
  • get_namespaces
  • is_empty
  • purge

🌈 SUPPORT AND DOCUMENTATION 🌈

questions and feedback? welcome πŸ’– and they should be directed to the perl-cache mailing list:

    http://groups.google.com/group/perl-cache-discuss

bugs and feature requests get tracked at RT:

    http://rt.cpan.org/NoAuth/Bugs.html?Dist=CHI-Driver-Memcached

and the latest source code can be browsed and fetched at:

    http://github.com/jonswar/perl-chi-driver-memcached/tree/master
    git clone git://github.com/jonswar/perl-chi-driver-memcached.git

πŸ‘‘ AUTHOR πŸ‘‘

Jonathan Swartz ✨


πŸ“ SEE ALSO πŸ“

CHI, Cache::Memcached, CHI::Driver::Memcached::Fast, CHI::Driver::Memcached::libmemcached

go read them, iykyk πŸ“š


Copyright (C) 2007 Jonathan Swartz.

CHI::Driver::Memcached is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.

⚠️ yes that means no warranty bestie, it's on you, don't @ me

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


This software is copyright (c) 2011 by Jonathan Swartz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie 🧚 this lil doc came to you via perl v5.36.0, dated 2022-10-16, and the manual page itself is CHI::D...cached(3pm). mwah, go cache something πŸ’–πŸŽ€

πŸ“¦ where this page comes from