colinmollenhour/Cm_Cache_Backend_File — pull request #22 by yireo (2014-08-15 11:04:16+00:00)
Title: Check file_exists() before file_get_contents()

In an environment with huge numbers of caching files, there are some scripts running to clean up files manually. Because of this, the cache cleanup of Magento is bypassed. And in this circumstance, it happens that the file_get_contents() call is made to a cache file that no longer exists. No harm done because of the @ you might think. Unfortunately, it still triggers an error that is written to the system.log if debugging is enabled. To prevent this from happening, this change simply makes an additional check with file_exists().

In my own case, the error with file_get_contents() happens so frequently, that the writing to the logs is actually slowing down the server. The downside of having to call file_exists() can be neglected when running a proper PHP accelerator (ZendOPC, APC).