Explicitly clear statcache before running file_exists
Use Fileinfo's exist method rather than performing a file exist check manually