Update memcache before clearing cache to limit the number of threads that are clearing the database