added a saveCacheFile() method