 	fileprivate let saveQueue: DispatchQueue
 	fileprivate let taskLockQueue: DispatchQueue
 	fileprivate var downloadAll: DownloadAll?
+	fileprivate var lastModTimes: [Int: TimeInterval] = [:]
 	
 	lazy var fileCacheUrl: URL = { () -> URL in
 		var fileDir: URL? = nil

	///   - observer: observer to signal data/completed or error
	private func loadContents(file: File, observer: Signal<Data, Rc2Error>.Observer) {
		let fileUrl = cachedUrl(file: file)
		guard fileUrl.fileExists() else {
			self.recache(file: file).startWithResult { result in
				guard result.error == nil else {
					observer.send(error: result.error!)

				//download already in progress. no need to erase
				return
			}
			if let mtime = self.lastModTimes[file.fileId] {
				let timediff = Date.timeIntervalSinceReferenceDate - mtime
				if timediff < 0.5 {
					os_log("skipping flush because too recent", log: .cache, type: .info)
					return
				}
			}
			os_log("flushing file %d", log: .cache, type: .info, file.fileId)
			self.removeFile(fileUrl: self.cachedUrl(file: file))
		}
	}
