Skip to content

Commit

Permalink
sync with main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 12, 2024
1 parent 1259311 commit a272276
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 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 a272276

Please sign in to comment.