Add automatic cache flushing.