base cache implementation