以下是memcached服务器中的密钥,
我如何以_session_id
为前缀
删除其他密钥,谢谢。
server = ENV['MEMCACHE_DB']
port = 11211
command = "flush_all\r\n"
socket = TCPSocket.new(server, port)
socket.write(command)
result = socket.recv(2)
if result != 'OK'
STDERR.puts "Error flushing memcached: #{result}"
end
socket.close
| id | expires | bytes | cache_key |
| 4 | 2016-03-01 07:56:32 +0000 | 74 | _session_id:c93a596166486d7d40cd6170b14c435d |
| 12 | 2015-09-03 07:53:08 +0000 | 1070 | views/footer |
| 13 | 2015-09-03 07:53:08 +0000 | 1162 | views/common_header |