1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import memcache
import simplejson
class SimplejsonWrapper(object):
def __init__(self, file, protocol=None):
self.file = file
def dump(self, value)
simplejson.dump(value, self.file)
def load(self):
return simplejson.load(self.file)
cache = memcache.Client(['127.0.0.1:11211'], pickler=SimplejsonWrapper, unpickler=SimplejsonWrapper)
|
More like this
- Check Size of Object in memcached by deryck 5 years, 6 months ago
- Extended cacheable callables and properties by gsakkis 2 years, 11 months ago
- Cache Manager by jerzyk 5 years, 5 months ago
- Dynamic Models Revisited by Ben 5 years, 7 months ago
- Non-pickling locmem (in-process memory) cache backend by akaihola 2 years, 2 months ago
Comments