Cache for binary and xml files

The file.write method returns false on writing binary data (Ti bug?) 
so we have to check if the cached file really exists. 
Slower, but is a workaround that allows us to cache binary and xml files.