async put(request, response, progress_callback = undefined) {
        let filePath = path.join(this.path, request);

        try {
            const contentLength = response.headers.get('Content-Length');
            const total = parseInt(contentLength ?? '0');
            let loaded = 0;

            await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
            const fileStream = fs.createWriteStream(filePath);
            const reader = response.body.getReader();

            while (true) {
                const { done, value } = await reader.read();
                if (done) {
                    break;
                }

                await new Promise((resolve, reject) => {
                    fileStream.write(value, (err) => {
                        if (err) {
                            reject(err);
                            return;
                        }
                        resolve();
                    });
                });

                loaded += value.length;
                const progress = total ? (loaded / total) * 100 : 0;

                progress_callback?.({ progress, loaded, total });
            }

            fileStream.close();
        } catch (error) {
            // Clean up the file if an error occurred during download
            try {
                await fs.promises.unlink(filePath);
            } catch { }
            throw error;
        }
    }
Adds the given response to the cache.
@param {string} request
@param {Response} response
@param {(data: {progress: number, loaded: number, total: number}) => void} [progress_callback] Optional.
The function to call with progress updates
@returns {Promise<void>}