Better file cache behavior

cc @harry-m