Usage within command‑line terminal

You will need to install Telnet first

Connect to Memcached via Telnet

The Telnet client is disabled by default on Windows, you need to enable it first:

Control Panel → Programs → Turn Windows features on or off → Check【Telnet Client】

Connection command:

telnet 127.0.0.1 11211Code language: CSS (css)

Five Essential Commands

General command format:

command key flags exptime bytes

Enter your payload after pressing enter

CommandPurposeExecution Result Description
setSet cache item, overwrite existing key, create new one if not existsReturns STORED on success
addAdd new cache entry, do nothing if key already existsNOT_STORED returned when key exists
replaceUpdate only existing key, no effect for non‑existent keyNOT_STORED returned when key missing
getRead cached value by keyReturn value / END(no data found)
deleteRemove cache for specified keyAppend target key: delete site

Practical Example

set site 0 0 7
foxdevelop.com
STORED

get site
VALUE site 0 7
foxdevelop.com
END

# Attempt add on existing key, will fail
add site 0 0 7
foxdevelop.com
NOT_STORED

# Replace to update value
replace site 0 0 7
foxdevelop.com2
STORED

# Delete entry
delete site
Code language: CSS (css)

Usage within command‑line terminal

Leave a Reply

Your email address will not be published. Required fields are marked *