mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-05-05 03:16:42 +00:00
Feat:支持文件数据库索引,优化访问速度;后台增加系统状态页面
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { purgeCFCache } from "../../../utils/purgeCache";
|
||||
import { addFileToIndex } from "../../../utils/indexManager.js";
|
||||
|
||||
export async function onRequest(context) {
|
||||
// Contents of context object
|
||||
@@ -33,6 +34,9 @@ export async function onRequest(context) {
|
||||
// 清除CDN缓存
|
||||
await purgeCFCache(env, cdnUrl);
|
||||
|
||||
// 更新索引
|
||||
waitUntil(addFileToIndex(context, params.path, value.metadata));
|
||||
|
||||
return new Response(info);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user