memorycache should be passed in the constructor