memcached 操作

来源:互联网 发布:淘宝商城女装夏装 编辑:程序博客网 时间:2024/06/09 12:18

add key flag expire length

key 键名flag 标志,由于memcached 只能存储字符串,所以对于数组序列化,json加密的就靠这个标志来区分expire 过期时间 0 不自动失效length 长度
add test 0 0 5hello

get key

get test

replace key flag expire length

replace test 0 0 5world

delete key [time] 可选参数代表删除后多长时间内不能再次使用

delete test

set 不存在新增,存在修改,兼具add,replace功能

set test 0 0 5hello

incr 给指定键增加指定值

incr age 1

decr 给指定的键减少指定的值

decr age 1

stats 统计信息
flush_all

原创粉丝点击