Fix caching when using remote redis server
Merge pull request #4775 from globin/remote_cache_redis

Fix caching when using remote redis server