From 4c5c62d8bf2d57f3752f4a5aff3e18f05b960599 Mon Sep 17 00:00:00 2001 From: vcheckzen <18008498+vcheckzen@users.noreply.github.com> Date: Sun, 13 Oct 2024 04:53:48 +0800 Subject: [PATCH] disable preload by default to avoid triggering excessive requests --- README.md | 1 - front-end/index.html | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f0808489..953ce5a1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ Fast OneDrive Index / FODI,无需服务器的 OneDrive 快速列表程序 #### 功能 -- 接近秒速列表 - 指定展示路径 - 特定文件夹加密 - 无需服务器免费部署 diff --git a/front-end/index.html b/front-end/index.html index bbfb2d0b..baf1076a 100644 --- a/front-end/index.html +++ b/front-end/index.html @@ -5,6 +5,7 @@ window.GLOBAL_CONFIG = { SCF_GATEWAY: `//tight-bar-e3b3.logi.workers.dev`, // Worker 或云函数网关地址 SITE_NAME: `FODI`, // 站点名称 + PRELOAD: false, IS_CF: true, }; @@ -1576,6 +1577,10 @@ } async function preCache(files, level) { + if (!window.GLOBAL_CONFIG.PRELOAD) { + return; + } + if (level > 1) return; files.files.forEach((file) => { const parent = files.parent === '/' ? '' : files.parent; @@ -1611,6 +1616,10 @@ } async function preCacheCheck(cache, path) { + if (!window.GLOBAL_CONFIG.PRELOAD) { + return; + } + cache.files.forEach((file) => { const prefix = path === window.api.root ? '' : path; const nextPath = prefix + '/' + file.name;