From 7b783c1fe3b7d2989516732da78ba8d39fce4f27 Mon Sep 17 00:00:00 2001 From: xream Date: Fri, 31 May 2024 20:52:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AE=80=E5=8D=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B9=90=E8=A7=82=E7=BC=93=E5=AD=98(=E5=BD=93=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=9B=B4=E6=96=B0=E4=B9=90=E8=A7=82=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=97=B6,=20=E8=8B=A5=E5=AD=98=E5=9C=A8=E5=B8=B8=E8=A7=84?= =?UTF-8?q?=E7=BC=93=E5=AD=98,=20=E5=B0=86=E4=BD=BF=E7=94=A8=E5=B8=B8?= =?UTF-8?q?=E8=A7=84=E7=BC=93=E5=AD=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/utils/download.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 8bc72d496..3cd4bb178 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.326", + "version": "2.14.327", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/utils/download.js b/backend/src/utils/download.js index 6e031cbb5..f3cfb221a 100644 --- a/backend/src/utils/download.js +++ b/backend/src/utils/download.js @@ -108,9 +108,13 @@ export default async function download( // try to find in app cache const cached = resourceCache.get(id); - if (!$arguments?.noCache && cached && !skipCustomCache) { + if (!$arguments?.noCache && cached) { $.info(`使用缓存: ${url}`); result = cached; + if (customCacheKey) { + $.info(`URL ${url}\n写入自定义缓存 ${$arguments?.cacheKey}`); + $.write(cached, customCacheKey); + } } else { $.info( `Downloading...\nUser-Agent: ${userAgent}\nTimeout: ${requestTimeout}\nProxy: ${proxy}\nURL: ${url}`,