Move cache purging out of doUpdates()