Bad Bad FileBackend
The FileBackend is not working under middle to high load and also not working relyable on shared filesystems
The main reason is the set function:
- All fileoperations need to be atomic - so why is ->remove() called and after this the file is written to some temp file and then renamed.
=> It should work by just removing the ->remove call, the rename method will replace the existing entry.
Also the while (!rename($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename) && $i < 5) seems to be unnecessary - why is this done?
Other improvements might be to get rid of the extra cache meta data for expire time - maybe using filemtime is faster at the end (it avoids expensive file_get_contents two times)