Updated persistent cache to use memcache if available