Make cache atomic.