CLIENT-CACHING(3valkey)
β¨ CLIENT-CACHING β¨
okay so bestie, this is a page from the Valkey Command Manual and we're about to talk about client-caching, which is genuinely one of those tiny commands that does one thing and does it flawlessly π
π NAME π
client-caching β Instructs the server whether to track the keys in the next request.
like. it's a little note to the server. "hey girl, the keys in my next command? track them. or don't. your call, but actually it's my call." π
π¦ SYNOPSIS π¦
CLIENT CACHING <YES | NO>
πΈ DESCRIPTION πΈ
So here's the tea, bestie. This command controls the tracking of the keys in the next command executed by the connection β but only when tracking is enabled in OPTIN or OPTOUT mode. If you want the full lore, go check the valkey-client-side-caching(7) client side caching documentation, it's giving background information and it's lowkey required reading. π
So when tracking is enabled in Valkey β using the valkey-client-tracking(7) CLIENT TRACKING command β you can specify the OPTIN or OPTOUT options, so that keys in read only commands are not automatically remembered by the server to be invalidated later. Iconic behaviour, honestly.
- When we're in
OPTINmode, we can enable the tracking of the keys in the next command by callingCLIENT CACHING yesimmediately before it. Like, right before. Don't dilly-dally. β° - Similarly, when we're in
OPTOUTmode and keys are normally tracked, we can avoid the keys in the next command being tracked by usingCLIENT CACHING no. π«
Basically the command sets a state in the connection, and that state is valid only for the next command execution β it's a one-command-only vibe, it will modify the behavior of client tracking and then it's gone, like a situationship. π
π REPLY π
valkey-protocol(7) Simple string reply: OK β or an error if the argument is not "yes" or "no".
not me typing CLIENT CACHING maybe and getting yelled at. it's literally just yes or no, bestie, no in-between. π
π COMPLEXITY π
constant time, queen behaviour, no notes. β¨
π ACL CATEGORIES π
@connection @slow
π§ HISTORY π§
- Available since:
6.0.0
she's been here since 6.0.0 and she's been serving ever since π«Ά
β SEE ALSO β
auth(3valkey), client(3valkey), client-capa(3valkey), client-getname(3valkey), client-getredir(3valkey), client-help(3valkey), client-id(3valkey), client-import-source(3valkey), client-info(3valkey), client-kill(3valkey), client-list(3valkey), client-no-evict(3valkey), client-no-touch(3valkey), client-pause(3valkey), client-reply(3valkey), client-setinfo(3valkey), client-setname(3valkey), client-tracking(3valkey), client-trackinginfo(3valkey), client-unblock(3valkey), client-unpause(3valkey), echo(3valkey), hello(3valkey), ping(3valkey), quit(3valkey), reset(3valkey), select(3valkey)
go read them all, i believe in you π
and that's the whole page, bestie!! π this was Valkey version 9.0.0, dated 2025-10-21, from the CLIENT-CACHING(3valkey) manual. slay, stay cached, and remember: the tracking state lasts exactly one command and then it's over πβ¨π¦
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms