Add if around memcache