Check each parent directory only once
Use cached OriginalFile rather than query