ruby訪問memcache[使用memcache-client1.7.0]

CharlesCui發表於2009-07-24
require 'memcache'
cache = MemCache::new ['10.2.225.208:13001',
'10.2.225.208:13002',
'10.2.225.208:13003:3'], # weighted
:debug => true,
:c_threshold => 100_000,
:compression => false,
:namespace => 'foo'
cache.servers += [ "10.2.225.208:13004:5" ]
cache.c_threshold = 10_000
cache.compression = true
cache["my_key"] = "Some value"
cache[:other_key] = "Another value"
[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9934490/viewspace-1024550/,如需轉載,請註明出處,否則將追究法律責任。

相關文章