     #endif
 
     // MARK: Caching
+
+    private func storeImageInCaches(_ response: ImageResponse) {
+        // Memory cache (ImageCaching)
+        pipeline.cache.storeCachedImage(response.container, for: request)
+        // Disk cache (DataCaching)
+        storeImageInDataCache(response)
+    }
 
     private func storeImageInDataCache(_ response: ImageResponse) {
         guard !response.container.isPreview else {


    #if os(macOS)
    private func decompressImage(_ response: ImageResponse, isCompleted: Bool) {
        pipeline.cache.storeCachedImage(response.container, for: request)
        send(value: response, isCompleted: isCompleted) // There is no decompression on macOS
    }
    #else
    private func decompressImage(_ response: ImageResponse, isCompleted: Bool) {
        guard isDecompressionNeeded(for: response) else {
            pipeline.cache.storeCachedImage(response.container, for: request)
            send(value: response, isCompleted: isCompleted)
            return
        }

    }

    private func didProduceProcessedImage(_ response: ImageResponse, isCompleted: Bool) {
        decompressImage(response, isCompleted: isCompleted)
    }

