feat: 默认查询流量信息的 User-AgentQuantumult%20X/1.0.30 (iPhone14,2; iOS 15.6) 改为 clash; 流量信息缓存逻辑调整

This commit is contained in:
xream
2024-11-17 02:10:38 +08:00
parent cfb5a8e082
commit dea937df66
3 changed files with 21 additions and 23 deletions

View File

@@ -151,7 +151,7 @@ export default async function download(
// try to find in app cache
const cached = resourceCache.get(id);
if (!noCache && !$arguments?.noCache && cached) {
$.info(`使用缓存: ${url}`);
$.info(`使用缓存: ${url}, ${userAgent}`);
result = cached;
if (customCacheKey) {
$.info(`URL ${url}\n写入自定义缓存 ${$arguments?.cacheKey}`);
@@ -179,7 +179,7 @@ export default async function download(
if (headers) {
const flowInfo = getFlowField(headers);
if (flowInfo) {
headersResourceCache.set(url, flowInfo);
headersResourceCache.set(id, flowInfo);
}
}
if (body.replace(/\s/g, '').length === 0)