TileStache.Memcache | index

`Caches tiles to Memcache.
Requires python-memcached:
http://pypi.python.org/pypi/python-memcached
Example configuration:
"cache": {
"name": "Memcache",
"servers": ["127.0.0.1:11211"],
"revision": 0,
"key prefix": "unique-id"
}
Memcache cache parameters:
servers
Optional array of servers, list of "{host}:{port}" pairs.
Defaults to ["127.0.0.1:11211"] if omitted.
revision
Optional revision number for mass-expiry of cached tiles
regardless of lifespan. Defaults to 0.
key prefix
Optional string to prepend to Memcache generated key.
Useful when running multiple instances of TileStache
that share the same Memcache instance to avoid key
collisions. The key prefix will be prepended to the
key name. Defaults to "".`

Classes

``

Cache

class Cache

``

Methods defined here:

__init__(self, servers=['127.0.0.1:11211'], revision=0, key_prefix='')

lock(self, layer, coord, format)
  `Acquire a cache lock for this tile.
  Returns nothing, but blocks until the lock has been acquired.`

read(self, layer, coord, format)
  `Read a cached tile.`

remove(self, layer, coord, format)
  `Remove a cached tile.`

save(self, body, layer, coord, format)
  `Save a cached tile.`

unlock(self, layer, coord, format)
  `Release a cache lock for this tile.`

Functions

``

tile_key(layer, coord, format, rev, key_prefix)
  `Return a tile key string.`