MEMCACHED_DELETE_BY_KEY(3)
π MEMCACHED_DELETE_BY_KEY π
okay bestie, welcome to libmemcached's delete-by-key page, it's giving very "clean up your own mess" energy and honestly? we love that for us β¨
π NAME π
memcached_delete_by_key β the libmemcached documentation, but make it a group chat π
πΈ SYNOPSIS πΈ
#include <libmemcached/memcached.h>
Compile and link with -lmemcached
memcached_return_t memcached_delete(memcached_st *ptr, const char *key,
size_t key_length, time_t expiration)
memcached_return_t memcached_delete_by_key(memcached_st *ptr, const char
*group_key, size_t group_key_length, const char *key, size_t key_length,
time_t expiration)
β¨ Parameters β¨
ptrβ pointer to initializedmemcached_ststructgroup_keyβ key namespacegroup_key_lengthβ length of thegroup_keywithout any terminating zerokeyβ the key to deletekey_lengthβ the length og the key without any terminating zeroexpirationβ obsolete sincememcached(1)version 1.4
yes bestie, "og" is literally in the original and I'm keeping it, it's canon now π
π«Ά Returns π«Ά
memcached_return_t indicating success
π¦ DESCRIPTION π¦
So memcached_delete() is the one you call when you want a particular key GONE. Poof. Deleted. It's the "I said what I said" of the memcached API π
memcached_delete_by_key() does the exact same thing, no cap β the only glow-up is that it takes a master key (that's your group_key) to find the given value. Think of it like the group chat finder so you know which namespace to go rummaging in π
Now, the expiration thing, and listen closely because this part is lowkey important:
Expiration works by placing the item into a delete queue. What that means in practice is that it won't be possible to retrieve it with the "get" command anymore. The "add" and "replace" commands with this key will also fail β but the "set" command will succeed, however. Then, after the time passes, the item is finally deleted from server memory. She's on her way out, she just hasn't left the building yet πͺ
β οΈ Please note the the memcached server removed tests for expiration in the 1.4 version. (And yes, that "the the" is the original's, I'm not fixing it, it's iconic π)
π RETURN VALUE π
A value of type memcached_return_t is returned. On success that value will be MEMCACHED_SUCCESS π
Use memcached_strerror() to translate this value to a printable string β because reading raw return codes is not the vibe, fr fr.
π heads up bestie: if you're using the non-blocking mode of the library, success only means that the message was queued for delivery. Queued β done, so don't come for me when it hasn't actually landed yet π
π SEE ALSO π
and that's the whole page, periodt π this was libmemcached-awesome version 1.1, dated Jul 24, 2025 β mwah, go delete some keys responsibly, bestie ππ¦β¨
π¦ where this page comes from
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms