Adding base cache logic