Skip to content
cheatsheet
home
/
cv
/
weblog
/
cheatsheet
/
proxy
/
vpn
/
status
/
links
EN
RU
☾
New version available
reload
×
cheatsheet
/
redis
/
Set key with TTL
Set key with TTL
redis
Set key with 1-hour expiry (EX = seconds)
redis-cli SET mykey 'value' EX 3600
⎘ copy
#redis
more redis
all 32 commands →
Increment counter
redis-cli INCRBY counter:hits 1
Pub/Sub publish
redis-cli PUBLISH events '{"type":"login","user":"alice"}'
Subscribe to channel
redis-cli SUBSCRIBE events
Show replication info
redis-cli INFO replication
Force save to disk (BGSAVE)
redis-cli BGSAVE && redis-cli LASTSAVE