Python: module TileStache.Redis

TileStache.Redis | index

`Caches tiles to Redis
Requires redis-py and redis-server
https://pypi.python.org/pypi/redis/
http://redis.io/
sudo apt-get install redis-server
pip install redis
Example configuration:
"cache": {
"name": "Redis",
"host": "localhost",
"port": 6379,
"db": 0,
"key prefix": "unique-id"
}
Redis cache parameters:
host
Defaults to "localhost" if omitted.
port
Integer; Defaults to 6379 if omitted.
db
Integer; Redis database number, defaults to 0 if omitted.
key prefix
Optional string to prepend to generated key.
Useful when running multiple instances of TileStache
that share the same Redis database to avoid key
collisions (though the prefered solution is to use a different
db number). The key prefix will be prepended to the
key name. Defaults to "".`

Modules
`` |  |
redis |  |  |

Classes
`` |  | Cache
class Cache
`` |  | Methods defined here: __init__(self, host='localhost', port=6379, db=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, key_prefix) `Return a tile key string.`

Data
`` |  | absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)