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}`,