Added redis and memcache logic