filecache search performance improvements

cc @DeepDiver1975 @karlitschek @MTGap