Add caching for file stat values.