untested code for cleaning up old cached indexes