safer file caching behavior