     /// Sweeps are performed in a background and can be performed in parallel
     /// with reading.
     public var sweepInterval: TimeInterval = 30
+
+    /// The delay after which the initial sweep is performed. 10 by default.
+    /// The initial sweep is performed after a delay to avoid competing with
+    /// other subsystems for the resources.
+    private var initialSweepDelay: TimeInterval = 15
 
     // Staging
     private let _lock = NSLock()

    public init(path: URL, filenameGenerator: @escaping (String) -> String? = DataCache.filename(for:)) throws {
        self.path = path
        self._filenameGenerator = filenameGenerator
        try FileManager.default.createDirectory(at: path, withIntermediateDirectories: true, attributes: nil)
    }

    /// A `FilenameGenerator` implementation which uses SHA1 hash function to


    // MARK: Sweep

    private func _performAndScheduleSweep() {
        _sweep()
        _wqueue.asyncAfter(deadline: .now() + sweepInterval) { [weak self] in
            self?._performAndScheduleSweep()
        }
    }

    /// Schedules a cache sweep to be performed immediately.
    public func sweep() {
        _wqueue.async {
            self._sweep()
        }
