"""Cache Connector to Dogpile Cache Uses Dogpile https://pypi.python.org/pypi/dogpile.cache. The expiration time is set to 1 hour for each key. You need to set env variable for MEMCACHE_HOST. """ from dogpile.cache import make_region from labelaudit import config if config.CACHE_ENABLED and config.REDIS: region = make_region().configure( 'dogpile.cache.redis', arguments=dict( url=config.REDIS, expiration_time=3600)) else: region = make_region().configure('dogpile.cache.null')