MEMCACHED_TOUCH(3)
π MEMCACHED_TOUCH π
okay bestie, welcome to MEMCACHED_TOUCH(3) β this one lives in the libmemcached-awesome manual, and it's literally the "hey, can you live a little longer?" function. refreshing a key's expiration like it's your duolingo streak π¦
β¨ NAME β¨
memcached_touch β libmemcached Documentation
no cap, that's the whole name section. short and iconic, we love a minimal queen π
β¨ SYNOPSIS β¨
#include <libmemcached/memcached.h>
Compile and link with -lmemcached
memcached_return_t memcached_touch(memcached_st *ptr, const char *key,
size_t key_length, time_t expiration)
Parameters πΈ
ptrβ pointer to initializedmemcached_ststructkeyβ the key to touchkey_lengthβ the length ofkeywithout any terminating zeroexpirationβ new expiration as a unix timestamp or as relative expiration time in seconds
Returns π«
memcached_return_t indicating success
memcached_return_t memcached_touch_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β the key namespacegroup_key_lengthβ the length ofgroup_keywithout any terminating zerokeyβ the key to touchkey_lengthβ the length ofkeywithout any terminating zeroexpirationβ new expiration as a unix timestamp or as relative expiration time in seconds
Returns π«
memcached_return_t indicating success
heads up bestie: those twokey_length/group_key_lengthparams want the length without any terminating zero. don't be out here counting the\0, she will not be included π
β¨ DESCRIPTION β¨
memcached_touch() is used to update the expiration time on an existing key. think of it as gently telling a value "you're not done yet, stay a while π₯Ί". no re-uploading, no re-setting, just extending the vibe.
memcached_touch_by_key() works the same, but it takes a master key to find the given value. so it's the same energy, just routed through the namespace first β main character energy via the group key π
β¨ 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 β like, if the return value is giving cryptic, that's your translator bestie π«Ά
β¨ SEE ALSO β¨
and that's the whole page, periodt π this was version 1.1, dated Jul 24, 2025 β go touch some keys (expiration-wise), ily, bye π§β¨
π¦ 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