Skip to content

Commit

Permalink
disable preload by default to avoid triggering excessive requests
Browse files Browse the repository at this point in the history
  • Loading branch information
vcheckzen committed Oct 12, 2024
1 parent 8ca50c0 commit 4c5c62d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Fast OneDrive Index / FODI,无需服务器的 OneDrive 快速列表程序

#### 功能

- 接近秒速列表
- 指定展示路径
- 特定文件夹加密
- 无需服务器免费部署
Expand Down
9 changes: 9 additions & 0 deletions front-end/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
window.GLOBAL_CONFIG = {
SCF_GATEWAY: `//tight-bar-e3b3.logi.workers.dev`, // Worker 或云函数网关地址
SITE_NAME: `FODI`, // 站点名称
PRELOAD: false,
IS_CF: true,
};
</script>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4c5c62d

Please sign in to comment.