Skip to content

Instantly share code, notes, and snippets.

@oosidat
Created June 11, 2025 21:02
Show Gist options
  • Save oosidat/ab29805456454b4bd43a4181e0b126cc to your computer and use it in GitHub Desktop.
Save oosidat/ab29805456454b4bd43a4181e0b126cc to your computer and use it in GitHub Desktop.
Memcached Meta Command Flags (2025-06)

Memcached Meta Command Flag table

Derived from https://github.com/memcached/memcached/blob/master/doc/protocol.txt, just in this format for easy access

Flag Commands Description
b mg, ms, md, ma, me Interpret key as base64 encoded binary value
c mg, ms, ma Return item CAS token
C(token) ms, md, ma Compare CAS value when storing/deleting
D(token) ma Delta to apply for arithmetic operation
E(token) mg, ms, md, ma Use token as new CAS value
f mg Return client flags token
F(token) ms Set client flags
h mg Return whether item has been hit before (0/1)
I ms, md Invalidate if CAS is older (ms) / Mark item stale (md)
J(token) ma Initial value to use if auto created
k mg, ms, md, ma Return key as token
l mg Return time since last item access
M(token) ms, ma Mode switch - storage mode for ms (add/append/prepend/replace/set), arithmetic mode for ma (incr/decr)
N(token) mg, ms, ma Vivify on miss with TTL (mg), autovivify on append miss (ms), auto create on miss (ma)
O(token) mg, ms, md, ma Opaque value for request tracking
q mg, ms, md, ma Use noreply semantics
R(token) mg Win recache if TTL is below token
s mg, ms Return item size token
t mg, ma Return remaining TTL (mg) / Return current TTL (ma)
T(token) mg, ms, md, ma Update remaining TTL (mg), set TTL (ms), update TTL when marking stale (md), update TTL on success (ma)
u mg Don't bump item in LRU
v mg, ma Return item value in data block (mg) / Return new value (ma)
x md Remove item value only
  Command Legend:
  - mg = Meta Get
  - ms = Meta Set
  - md = Meta Delete
  - ma = Meta Arithmetic
  - me = Meta Debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment