Working connection error handling and caching to files.  Recovers files from cache.